better start script

This commit is contained in:
Ludwig Lehnert 2025-02-16 08:27:37 +01:00
parent d3a17f6651
commit 9676f51765

View File

@ -1,13 +1,6 @@
#!/bin/env fish #!/bin/env fish
if ! test -d venv set DIR (cd (dirname (status -f)); and pwd)
/bin/env python3 -m venv venv
. venv/bin/activate.fish
/bin/env python3 -m pip install -r requirements.txt
echo
else
. venv/bin/activate.fish
end
if ! type -q curl if ! type -q curl
echo "curl is required to run this script" echo "curl is required to run this script"
@ -24,6 +17,14 @@ if ! type -q ffmpeg
exit exit
end end
if ! /bin/env python3 download.py $argv
echo "download failed" if ! test -d "$DIR/venv"
/bin/env python3 -m venv "$DIR/venv"
. "$DIR/venv/bin/activate.fish"
/bin/env python3 -m pip install -r "$DIR/requirements.txt"
echo
else
. "$DIR/venv/bin/activate.fish"
end end
/bin/env python3 "$DIR/download.py" $argv