assume-role icon indicating copy to clipboard operation
assume-role copied to clipboard

Doesn't work in git-bash on windows

Open veqryn opened this issue 7 years ago • 3 comments

I use git-bash on windows (what you get when you install git for windows). I get the following error when running assume-role. I assume it is because the app is expecting to only be run from powershell when on windows?

MinGW 01:53:33 ~/workspace/go/src/github.com/xxx/xxx$ assume-role eo
$env:AWS_ACCESS_KEY_ID="xxx"
$env:AWS_SECRET_ACCESS_KEY="xxx"
$env:AWS_SESSION_TOKEN=""
$env:AWS_SECURITY_TOKEN=""
$env:ASSUMED_ROLE="xx"
# Run this to configure your shell:
# C:\Users\xxx\workspace\programs\bin\assume-role.exe eo | Invoke-Expression
MinGW 01:53:41 ~/workspace/go/src/github.com/xxx/xxx$ $(assume-role eo)
bash: $env:AWS_ACCESS_KEY_ID="xxx": command not found

veqryn avatar Aug 11 '17 20:08 veqryn

@yunspace any thoughts on this? Would it be possible to expand on the runtime.GOOS == 'windows' check to also check if the command is running from powershell? I'm not a windows user, so not sure what the best practices are for building powershell compatible CLI's.

ejholmes avatar Aug 11 '17 22:08 ejholmes

this is a very valid use case... will take a look to see if it's possible to distinguish powershell on windows

mrserverless avatar Aug 15 '17 09:08 mrserverless

I originally tried to use os.PathSeparator but later resorted to using $SHELL env var. This works correctly and I've tested on powershell, windows 10 ubuntu bash and MINGW/git-bash. PR is #21

I think this issue can be resolved with this change and the new -format flag

mrserverless avatar Sep 06 '17 12:09 mrserverless