Newton_Editor/user_config/bin/newton

30 lines
578 B
Bash
Executable File

#!/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=""
if [[ ! "${1::1}" == /* ]]; then
path="${call_path}/${1}"
else
path="${1}"
fi
# NOTE: Remove if you want to pass file(s) besides directories...
if [ ! -f "${path}" ]; then
echo "Newton: Path given not a file..."
exit 1
fi
cd "/opt/"
python /opt/newton.zip "$@"
}
main "$@";