fix cwd
This commit is contained in:
@@ -52,7 +52,8 @@ if [ $# -ge 1 ]; then
|
||||
name_lc=$(echo "${edition_names[$i]}" | tr '[:upper:]' '[:lower:]')
|
||||
arg_lc=$(echo "$arg" | tr '[:upper:]' '[:lower:]')
|
||||
if [ "$arg_lc" = "$name_lc" ]; then
|
||||
exec "${editions[$i]}"
|
||||
dir="${editions[$i]%/*}"
|
||||
cd "$dir" && exec ./run.sh
|
||||
fi
|
||||
done
|
||||
echo -e "${RED}Unknown edition: $arg${NC}" >&2
|
||||
@@ -78,7 +79,7 @@ if command -v whiptail >/dev/null 2>&1; then
|
||||
case "$choice" in
|
||||
u) run_updater;;
|
||||
q|"") exit 0;;
|
||||
*) [[ "$choice" =~ ^[0-9]+$ ]] && exec "${editions[$((choice-1))]}" ;;
|
||||
*) [[ "$choice" =~ ^[0-9]+$ ]] && { d="${editions[$((choice-1))]%/*}"; cd "$d" && exec ./run.sh; } ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
@@ -103,7 +104,8 @@ while true; do
|
||||
if [[ "$choice" =~ ^[0-9]+$ ]] && \
|
||||
[ "$choice" -ge 1 ] && \
|
||||
[ "$choice" -le "${#editions[@]}" ]; then
|
||||
exec "${editions[$((choice-1))]}"
|
||||
d="${editions[$((choice-1))]%/*}"
|
||||
cd "$d" && exec ./run.sh
|
||||
else
|
||||
echo -e "${RED}Invalid choice${NC}"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user