In this case, /home/root/... path doesn't exist, so we use a hacky way
to get the scripts' path.
set -e #exit on error
+# Find script location
+ARCH_SCRIPTS=$(dirname "$(readlink /proc/$$/fd/255)")
+
#Include basic functions
-source /home/$(logname)/archipelago/arch-scripts/init.sh
+source $ARCH_SCRIPTS/init.sh
SED_XSEG=$(echo "${XSEG}/" | sed 's/\//\\\//g')
INCLUDE="--include=*.c --include=*.h"
echo -e "${txtgrn}${1}${txtrst}"
}
-XSEG=/home/$(logname)/archipelago/xseg
+#ARCH_SCRIPTS must be already set by the caller function
+XSEG=$ARCH_SCRIPTS/../xseg
set -e #exit on error
+# Find script location
+ARCH_SCRIPTS=$(dirname "$(readlink /proc/$$/fd/255)")
+
#Include basic functions
-source /home/$(logname)/archipelago/arch-scripts/init.sh
+source $ARCH_SCRIPTS/init.sh
PIPE="1>/dev/null"