From 965e54a925c886a9f277e2cab2124aec9912cc9f Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Mon, 25 Nov 2024 00:11:39 +0100 Subject: [PATCH] Have install.sh also place executable code, including ~/.config/bin/ytplom wrapping necessary venv stuff. --- install.sh | 5 ++++- .../requirements.txt | 0 ytplom.py => install_to_share/ytplom.py | 0 {ytplom => install_to_share/ytplom}/__init__.py | 0 {ytplom => install_to_share/ytplom}/misc.py | 0 ytplom | 12 ++++++++++++ 6 files changed, 16 insertions(+), 1 deletion(-) rename requirements.txt => install_to_share/requirements.txt (100%) rename ytplom.py => install_to_share/ytplom.py (100%) rename {ytplom => install_to_share/ytplom}/__init__.py (100%) rename {ytplom => install_to_share/ytplom}/misc.py (100%) create mode 100755 ytplom diff --git a/install.sh b/install.sh index 0661178..085c187 100755 --- a/install.sh +++ b/install.sh @@ -3,5 +3,8 @@ set -e set -x PATH_APP_SHARE=~/.local/share/ytplom -mkdir -p "${PATH_APP_SHARE}" +PATH_LOCAL_BIN=~/.local/bin + +mkdir -p "${PATH_APP_SHARE}" "${PATH_LOCAL_BIN}" cp -r ./install_to_share/* "${PATH_APP_SHARE}/" +cp ytplom "${PATH_LOCAL_BIN}/" diff --git a/requirements.txt b/install_to_share/requirements.txt similarity index 100% rename from requirements.txt rename to install_to_share/requirements.txt diff --git a/ytplom.py b/install_to_share/ytplom.py similarity index 100% rename from ytplom.py rename to install_to_share/ytplom.py diff --git a/ytplom/__init__.py b/install_to_share/ytplom/__init__.py similarity index 100% rename from ytplom/__init__.py rename to install_to_share/ytplom/__init__.py diff --git a/ytplom/misc.py b/install_to_share/ytplom/misc.py similarity index 100% rename from ytplom/misc.py rename to install_to_share/ytplom/misc.py diff --git a/ytplom b/ytplom new file mode 100755 index 0000000..e31cb50 --- /dev/null +++ b/ytplom @@ -0,0 +1,12 @@ +#!/usr/bin/sh +set -e +set -x + +PATH_APP_SHARE=~/.local/share/ytplom +PATH_VENV="${PATH_APP_SHARE}/venv" + +python3 -m venv "${PATH_VENV}" +. "${PATH_VENV}/bin/activate" +pip3 install -r "${PATH_APP_SHARE}/requirements.txt" +export PYTHONPATH="${PATH_APP_SHARE}:${PYTHONPATH}" +python3 "${PATH_APP_SHARE}/ytplom.py" -- 2.30.2