Enhanced launcher by collecting relative paths when running from the terminal

This commit is contained in:
2023-10-27 22:57:28 -05:00
parent dbc198513f
commit 1f4584d801
4 changed files with 27 additions and 11 deletions

View File

@@ -11,19 +11,23 @@ function main() {
call_path=`pwd`
path=""
# NOTE: Remove if you want to pass file(s) besides directories...
if [[ ! "${1::1}" == /* ]]; then
path="${call_path}/${1}"
else
path="${1}"
fi
# NOTE: Remove if you want to pass file(s) besides directories...
if [ ! -d "${path}" ]; then
echo "<change_me>: Path given not a directory..."
exit 1
fi
# End NOTE: Remove if you want to pass file(s) besides directories...
# Collect abs paths and stuff in 'files' array
mapfile -t files < <(readlink -f "$@")
cd "/opt/"
python /opt/<change_me>.zip "$@"
}
main "$@";
main "$@";