ibm-functions / shell

An Electron-based development tool for IBM Cloud Functions and Composer.
Apache License 2.0
60 stars 16 forks source link

fsh does not run in Windows Git Bash environment #44

Closed saulimus closed 6 years ago

saulimus commented 6 years ago

Running fsh in a Windows Git Bash environment does not work. Tested version: 1.3.353 Output:

$ fsh
/c/Program Files/nodejs/node_modules/@ibm-functions/shell/bin/fsh: line 43: /c/Program Files/nodejs/node_modules/@ibm-functions/shell/bin/../dist/IBM Cloud Functions Shell-mingw64_nt-10.0-x64/IBM Cloud Functions Shell: No such file or directory

Cause: In @ibm-functions/shell/bin/fsh script the PLATFORM variable has the value of "mingw64_nt-10.0" and the platform detection does not recognize it properly.

My fix (using example from https://stackoverflow.com/a/17072017/8731727): Replace

elif [ "${PLATFORM}" == "win32" ]; then
    BIN="$DIR/../dist/IBM Cloud Functions Shell-${PLATFORM}-x64/IBM Cloud Functions Shell.exe"

with

elif [ "${PLATFORM}" == "win32" ] || [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ] || [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
    BIN="$DIR/../dist/IBM Cloud Functions Shell-win32-x64/IBM Cloud Functions Shell.exe"
starpit commented 6 years ago

this is great, thanks!! a fix should arrive when 1.3.355 is released

a91cfbc701442c4b6456660f9e75ff936e8c5376