From 6a6695f2f10388d14175443fe46a003bc533e73a Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Mon, 25 Nov 2024 01:34:20 +0100 Subject: [PATCH] Include sync script in installation, denoise shell script outputs. --- install.sh | 8 +++++--- {install_to_share => src}/migrations/init_0.sql | 0 {install_to_share => src}/requirements.txt | 0 install_to_share/ytplom.py => src/serve.py | 0 sync.py => src/sync.py | 0 {install_to_share => src}/templates/_base.tmpl | 0 {install_to_share => src}/templates/_macros.tmpl | 0 {install_to_share => src}/templates/playlist.tmpl | 0 {install_to_share => src}/templates/queries.tmpl | 0 {install_to_share => src}/templates/results.tmpl | 0 {install_to_share => src}/templates/video.tmpl | 0 {install_to_share => src}/templates/videos.tmpl | 0 {install_to_share => src}/templates/yt_video.tmpl | 0 {install_to_share => src}/ytplom/__init__.py | 0 {install_to_share => src}/ytplom/misc.py | 0 ytplom | 9 +++++++-- 16 files changed, 12 insertions(+), 5 deletions(-) rename {install_to_share => src}/migrations/init_0.sql (100%) rename {install_to_share => src}/requirements.txt (100%) rename install_to_share/ytplom.py => src/serve.py (100%) rename sync.py => src/sync.py (100%) rename {install_to_share => src}/templates/_base.tmpl (100%) rename {install_to_share => src}/templates/_macros.tmpl (100%) rename {install_to_share => src}/templates/playlist.tmpl (100%) rename {install_to_share => src}/templates/queries.tmpl (100%) rename {install_to_share => src}/templates/results.tmpl (100%) rename {install_to_share => src}/templates/video.tmpl (100%) rename {install_to_share => src}/templates/videos.tmpl (100%) rename {install_to_share => src}/templates/yt_video.tmpl (100%) rename {install_to_share => src}/ytplom/__init__.py (100%) rename {install_to_share => src}/ytplom/misc.py (100%) diff --git a/install.sh b/install.sh index 085c187..a2bd9c1 100755 --- a/install.sh +++ b/install.sh @@ -1,10 +1,12 @@ #!/usr/bin/sh set -e -set -x PATH_APP_SHARE=~/.local/share/ytplom PATH_LOCAL_BIN=~/.local/bin +NAME_EXECUTABLE=ytplom mkdir -p "${PATH_APP_SHARE}" "${PATH_LOCAL_BIN}" -cp -r ./install_to_share/* "${PATH_APP_SHARE}/" -cp ytplom "${PATH_LOCAL_BIN}/" +cp -r ./src/* "${PATH_APP_SHARE}/" +cp "${NAME_EXECUTABLE}" "${PATH_LOCAL_BIN}/" + +echo "Installed executable to ${PATH_LOCAL_BIN}/${NAME_EXECUTABLE}, app files to ${PATH_APP_SHARE}." diff --git a/install_to_share/migrations/init_0.sql b/src/migrations/init_0.sql similarity index 100% rename from install_to_share/migrations/init_0.sql rename to src/migrations/init_0.sql diff --git a/install_to_share/requirements.txt b/src/requirements.txt similarity index 100% rename from install_to_share/requirements.txt rename to src/requirements.txt diff --git a/install_to_share/ytplom.py b/src/serve.py similarity index 100% rename from install_to_share/ytplom.py rename to src/serve.py diff --git a/sync.py b/src/sync.py similarity index 100% rename from sync.py rename to src/sync.py diff --git a/install_to_share/templates/_base.tmpl b/src/templates/_base.tmpl similarity index 100% rename from install_to_share/templates/_base.tmpl rename to src/templates/_base.tmpl diff --git a/install_to_share/templates/_macros.tmpl b/src/templates/_macros.tmpl similarity index 100% rename from install_to_share/templates/_macros.tmpl rename to src/templates/_macros.tmpl diff --git a/install_to_share/templates/playlist.tmpl b/src/templates/playlist.tmpl similarity index 100% rename from install_to_share/templates/playlist.tmpl rename to src/templates/playlist.tmpl diff --git a/install_to_share/templates/queries.tmpl b/src/templates/queries.tmpl similarity index 100% rename from install_to_share/templates/queries.tmpl rename to src/templates/queries.tmpl diff --git a/install_to_share/templates/results.tmpl b/src/templates/results.tmpl similarity index 100% rename from install_to_share/templates/results.tmpl rename to src/templates/results.tmpl diff --git a/install_to_share/templates/video.tmpl b/src/templates/video.tmpl similarity index 100% rename from install_to_share/templates/video.tmpl rename to src/templates/video.tmpl diff --git a/install_to_share/templates/videos.tmpl b/src/templates/videos.tmpl similarity index 100% rename from install_to_share/templates/videos.tmpl rename to src/templates/videos.tmpl diff --git a/install_to_share/templates/yt_video.tmpl b/src/templates/yt_video.tmpl similarity index 100% rename from install_to_share/templates/yt_video.tmpl rename to src/templates/yt_video.tmpl diff --git a/install_to_share/ytplom/__init__.py b/src/ytplom/__init__.py similarity index 100% rename from install_to_share/ytplom/__init__.py rename to src/ytplom/__init__.py diff --git a/install_to_share/ytplom/misc.py b/src/ytplom/misc.py similarity index 100% rename from install_to_share/ytplom/misc.py rename to src/ytplom/misc.py diff --git a/ytplom b/ytplom index e31cb50..64d1981 100755 --- a/ytplom +++ b/ytplom @@ -1,12 +1,17 @@ #!/usr/bin/sh set -e -set -x PATH_APP_SHARE=~/.local/share/ytplom PATH_VENV="${PATH_APP_SHARE}/venv" +if [ ! "$1" = 'serve' ] && [ ! "$1" = 'sync' ]; then + echo "Need argument (either 'serve' or 'sync')." + false +fi + python3 -m venv "${PATH_VENV}" . "${PATH_VENV}/bin/activate" +echo "Checking dependencies." pip3 install -r "${PATH_APP_SHARE}/requirements.txt" export PYTHONPATH="${PATH_APP_SHARE}:${PYTHONPATH}" -python3 "${PATH_APP_SHARE}/ytplom.py" +python3 "${PATH_APP_SHARE}/${1}.py" -- 2.30.2