Skip to content
Snippets Groups Projects
dosh 1.32 KiB
Newer Older
  • Learn to ignore specific revisions
  • #!/usr/bin/env bash
    
    SCRIPTNAME=dosh
    BASEDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/..
    
    # Call the upstream dosh
    
    James Vasile's avatar
    James Vasile committed
    watch(){ ${OTS_DOCTOOLS_DIR}/dosh ${FUNCNAME[0]} $@; }
    verify_pdf_links(){ ${OTS_DOCTOOLS_DIR}/dosh ${FUNCNAME[0]} $@; }
    
    
    _dload(){
    	if [ -f "$2" ]; then
    		return
    	fi
    	wget -O $2 $1
    }
    
    docs_kde() {
    	mkdir -p $BASEDIR/doc/kde/.cache
    	cd $BASEDIR/doc/kde/.cache
    
    	# Don't download if it already exists
    	if [ -f  ../kdefreeqt.pdf ]; then
    		return
    	fi
    
    	_dload https://kde.org/community/whatiskde/images/kdefreeqt0.png kdefreeqt0.png
    	_dload https://kde.org/community/whatiskde/images/kdefreeqt1.png kdefreeqt1.png
    	_dload https://kde.org/community/whatiskde/images/kdefreeqt2.png kdefreeqt2.png
    	_dload https://kde.org/community/whatiskde/images/kdefreeqt3.png kdefreeqt3.png
    	_dload https://kde.org/community/whatiskde/images/kdefreeqt4.png kdefreeqt4.png
    	_dload https://kde.org/community/whatiskde/images/kdefreeqt5.png kdefreeqt5.png
    	_dload https://kde.org/community/whatiskde/images/kdefreeqt6.png kdefreeqt6.png
    	_dload https://kde.org/community/whatiskde/images/kdefreeqt7.png kdefreeqt7.png
    	convert kdefreeqt*.png ../kdefreeqt.pdf
    }
    
    docs() {
    	docs_kde
    }
    
    "$@" # <- execute the task
    [ "$#" -gt 0 ] || printf "Usage:\n\t./${SCRIPTNAME} %s\n" "($(compgen -A function | grep '^[^_]' | paste -sd '|' -))"