From d462ee28a5183524eadc90f4ef14fd4db0fa4a2c Mon Sep 17 00:00:00 2001 From: fniesel <57442202+fniesel@users.noreply.github.com> Date: Mon, 23 Jan 2023 11:27:38 +0100 Subject: [PATCH] Added interpreter script --- create_interpreter.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 create_interpreter.sh diff --git a/create_interpreter.sh b/create_interpreter.sh new file mode 100755 index 0000000..1dc72b4 --- /dev/null +++ b/create_interpreter.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +SOURCE_PATH="${BASH_SOURCE[0]:-${(%):-%x}}" + +RELATIVE_PATH="$(dirname "$SOURCE_PATH")" +ABSOLUTE_PATH="$(realpath "${RELATIVE_PATH}")" +source "${ABSOLUTE_PATH}"/config.sh + +echo the name is "$ENV_NAME" + +echo "Setting up the python interpreter script in the following dir: " "~/.local/share/python/interpreter/${ENV_NAME}" + +mkdir -p ~/.local/share/python/interpreter/"${ENV_NAME}" + +echo ' +#!/bin/bash +source "'"${ABSOLUTE_PATH}"'"/activate.sh 2> /dev/null > /dev/null +python "$@" +' > ~/.local/share/python/interpreter/"${ENV_NAME}"/python + +chmod a+x ~/.local/share/python/interpreter/"${ENV_NAME}"/python -- GitLab