{ lib , writeShellApplication , python3 , pywikibot-scripts , pywikibot }: writeShellApplication { name = "pywb"; text = '' pwbs="${pywikibot-scripts}/${python3.sitePackages}/scripts" cmd="''${1:-}"; shift if [ -z "$cmd" ]; then echo "not specified command to run" >&2 exit 2 fi if [ -f "$pwbs/$cmd.py" ]; then exec "${pywikibot}/bin/pwb" "$pwbs/$cmd" "$@" elif [ -f "$pwbs/$cmd" ]; then exec "${pywikibot}/bin/pwb" "$pwbs/$cmd" "$@" else if [ "$cmd" = "__get_path" ]; then echo "$pwbs" exit elif [ "$cmd" = "--ls" ]; then ls "$pwbs" "$@" exit fi echo "$cmd not found in pywkibot's scripts folder (make sure it doesn't end in .py)" >&2 exit 1 fi ''; }