From 2f851352484cd0f8ad415dd765163b4a94c95ba8 Mon Sep 17 00:00:00 2001 From: Plom Heller Date: Mon, 3 Aug 2026 09:30:19 +0200 Subject: [PATCH] Allow install.sh APP_NAME no_deps for apps without dependencies. --- sh/install.sh | 7 ++++++- sh/install/run.bottom | 3 +++ sh/install/run.top | 8 ++++++++ sh/{run => install/run.venv} | 9 --------- 4 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 sh/install/run.bottom create mode 100644 sh/install/run.top rename sh/{run => install/run.venv} (56%) diff --git a/sh/install.sh b/sh/install.sh index 1127276..7c264ce 100755 --- a/sh/install.sh +++ b/sh/install.sh @@ -8,9 +8,14 @@ mkdir -p "${PATH_APP_SHARE}" cp -rL ./src/* "${PATH_APP_SHARE}/" PATH_LOCAL_BIN=~/.local/bin +PATH_RUN=plomlib/sh/install/run mkdir -p "${PATH_LOCAL_BIN}" PATH_TARGET_BIN="${PATH_LOCAL_BIN}/${APP_NAME}" -cat plomlib/sh/run | sed "s/PLEASE_DO_REPLACE_ME/${APP_NAME}/g" > "${PATH_TARGET_BIN}" +cat "${PATH_RUN}.top" | sed "s/PLEASE_DO_REPLACE_ME/${APP_NAME}/g" > "${PATH_TARGET_BIN}" +if [ "$2" != "no_deps" ]; then + cat "${PATH_RUN}.venv" >> "${PATH_TARGET_BIN}" +fi +cat "${PATH_RUN}.bottom" >> "${PATH_TARGET_BIN}" chmod u+x "${PATH_TARGET_BIN}" echo "Installed executable to ${PATH_TARGET_BIN}, app files to ${PATH_APP_SHARE}." diff --git a/sh/install/run.bottom b/sh/install/run.bottom new file mode 100644 index 0000000..c3f8826 --- /dev/null +++ b/sh/install/run.bottom @@ -0,0 +1,3 @@ +export PYTHONPATH="${PATH_APP_SHARE}:${PYTHONPATH}" +cd "${PATH_APP_SHARE}" +./run.py $@ diff --git a/sh/install/run.top b/sh/install/run.top new file mode 100644 index 0000000..2856fe3 --- /dev/null +++ b/sh/install/run.top @@ -0,0 +1,8 @@ +#!/usr/bin/sh +set -e + +APP_NAME=PLEASE_DO_REPLACE_ME + +PATH_APP_SHARE=~/.local/share/"${APP_NAME}" +PATH_VENV="${PATH_APP_SHARE}/venv" + diff --git a/sh/run b/sh/install/run.venv similarity index 56% rename from sh/run rename to sh/install/run.venv index fc89619..00563c7 100644 --- a/sh/run +++ b/sh/install/run.venv @@ -1,9 +1,3 @@ -#!/usr/bin/sh -set -e - -APP_NAME=PLEASE_DO_REPLACE_ME - -PATH_APP_SHARE=~/.local/share/"${APP_NAME}" PATH_VENV="${PATH_APP_SHARE}/venv" python3 -m venv "${PATH_VENV}" @@ -15,6 +9,3 @@ if [ "$1" = "install_deps" ]; then exit 0 fi -export PYTHONPATH="${PATH_APP_SHARE}:${PYTHONPATH}" -cd "${PATH_APP_SHARE}" -./run.py $@ -- 2.30.2