home · contact · privacy
Allow install.sh APP_NAME no_deps for apps without dependencies. master
authorPlom Heller <plom@plomlompom.com>
Mon, 3 Aug 2026 07:30:19 +0000 (09:30 +0200)
committerPlom Heller <plom@plomlompom.com>
Mon, 3 Aug 2026 07:30:19 +0000 (09:30 +0200)
sh/install.sh
sh/install/run.bottom [new file with mode: 0644]
sh/install/run.top [new file with mode: 0644]
sh/install/run.venv [new file with mode: 0644]
sh/run [deleted file]

index 11272762001b5a5e48d5e5ecd3cda6770939a100..7c264ce501cd03b4ce63a00aabf4391e5062480b 100755 (executable)
@@ -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 (file)
index 0000000..c3f8826
--- /dev/null
@@ -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 (file)
index 0000000..2856fe3
--- /dev/null
@@ -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/install/run.venv b/sh/install/run.venv
new file mode 100644 (file)
index 0000000..00563c7
--- /dev/null
@@ -0,0 +1,11 @@
+PATH_VENV="${PATH_APP_SHARE}/venv"
+
+python3 -m venv "${PATH_VENV}"
+. "${PATH_VENV}/bin/activate"
+
+if [ "$1" = "install_deps" ]; then
+    echo "Checking dependencies."
+    pip3 install -r "${PATH_APP_SHARE}/requirements.txt"
+    exit 0
+fi
+
diff --git a/sh/run b/sh/run
deleted file mode 100644 (file)
index fc89619..0000000
--- a/sh/run
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/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}"
-. "${PATH_VENV}/bin/activate"
-
-if [ "$1" = "install_deps" ]; then
-    echo "Checking dependencies."
-    pip3 install -r "${PATH_APP_SHARE}/requirements.txt"
-    exit 0
-fi
-
-export PYTHONPATH="${PATH_APP_SHARE}:${PYTHONPATH}"
-cd "${PATH_APP_SHARE}"
-./run.py $@