Skip to content

Commit a01a485

Browse files
committed
controller: fix script compatibility with Windows
1 parent 2f4d368 commit a01a485

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

controller.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,18 @@ if [ ! -f "$SCRIPT_PATH" ]; then
2929
exit 1
3030
fi
3131

32-
CMD="$SCRIPT_PATH"
32+
33+
echo "-------------------------"
34+
echo "Executing $SCRIPT_NAME..."
35+
36+
chmod +x "$SCRIPT_PATH"
3337
OS=$(uname -s)
3438
if [[ "$OS" == "MINGW"* || "$OS" == "CYGWIN"* || "$OS" == "MSYS"* ]]; then
35-
CMD="winpty $CMD"
39+
winpty bash "$SCRIPT_PATH"
40+
else
41+
bash "$SCRIPT_PATH"
3642
fi
3743

38-
chmod +x "$SCRIPT_PATH"
39-
echo "----------------------"
40-
echo "Executing $SCRIPT_NAME..."
41-
"$CMD"
42-
4344
if [ "$NO_CONFIRM" = false ]; then
4445
chmod +x "$SCRIPT_DIR/on_exit.sh"
4546
"$SCRIPT_DIR/on_exit.sh"

0 commit comments

Comments
 (0)