-
Notifications
You must be signed in to change notification settings - Fork 1
/
totalcmd
executable file
·21 lines (18 loc) · 990 Bytes
/
totalcmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
[ $# -ge 1 ] && eval last=\"\${$#}\"
[ -e "$last" ] && last="$(winpath -aw "$last")" && set -- "${@:1:$(($#-1))}"
ProgramFiles="$(winpath "$(cmd.exe /c "<nul set /p=%ProgramFiles%" 2>/dev/null)")"
COMMANDER_PATH="$(winpath "$(cmd.exe /c "<nul set /p=%COMMANDER_PATH%" 2>/dev/null)")"
if command -v totalcmd64.exe >/dev/null 2>&1; then
totalcmd64.exe "$@" ${last:+"$last"}
elif command -v totalcmd.exe >/dev/null 2>&1; then
totalcmd.exe "$@" ${last:+"$last"}
elif [ -x "$COMMANDER_PATH/totalcmd64.exe" ]; then
"$COMMANDER_PATH/totalcmd64.exe" "$@" ${last:+"$last"}
elif [ -x "$COMMANDER_PATH/totalcmd.exe" ]; then
"$COMMANDER_PATH/totalcmd.exe" "$@" ${last:+"$last"}
elif [ -x "${ProgramFiles}/Total Commander/totalcmd64.exe" ]; then
"${ProgramFiles}/Total Commander/totalcmd64.exe" "$@" ${last:+"$last"}
elif [ -x "${ProgramFiles} (x86)/Total Commander/totalcmd.exe" ]; then
"${ProgramFiles} (x86)/Total Commander/totalcmd.exe" "$@" ${last:+"$last"}
fi