Python-With-Gtk-Template/user_config/bin/<change_me>

39 lines
882 B
Plaintext
Raw Normal View History

#!/bin/bash
# . CONFIG.sh
# set -o xtrace ## To debug scripts
# set -o errexit ## To exit on error
# set -o errunset ## To exit if a variable is referenced but not set
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
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
2023-10-28 05:52:33 +00:00
files=()
for f in "$@"; do
target=$(readlink -f "${f}")
i="${#files[@]}"
size=$(($i + 1))
files[$size]="${target}"
done
cd "/opt/"
python /opt/<change_me>.zip "$@"
}
main "$@";