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