#!/bin/bash
echo "App Runner - hacktolive.org/runner"
echo
#get the directory (location) of the file
PATH_OF_FILE="$@"
PROPER_DIRECTORY=$(dirname "$PATH_OF_FILE")
FILE_NAME=$(basename "$PATH_OF_FILE")
#change into de directory of the file
cd "$PROPER_DIRECTORY"
#make file executable
chmod a+x ./"$FILE_NAME"
echo "Preparing to launch "$FILE_NAME"..."
echo
echo "Do not close this window!"
echo
#Run the file
./"$FILE_NAME"
#Final message
echo
echo
echo
echo
echo "App Runner has finished... you can now close this window."
read