Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work in git-bash on windows #16

Open
veqryn opened this issue Aug 11, 2017 · 3 comments
Open

Doesn't work in git-bash on windows #16

veqryn opened this issue Aug 11, 2017 · 3 comments

Comments

@veqryn
Copy link
Contributor

veqryn commented Aug 11, 2017

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
@ejholmes
Copy link
Contributor

@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.

@mrserverless
Copy link
Contributor

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

mrserverless pushed a commit to mrserverless/assume-role that referenced this issue Sep 6, 2017
mrserverless pushed a commit to mrserverless/assume-role that referenced this issue Sep 6, 2017
@mrserverless
Copy link
Contributor

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 pushed a commit to mrserverless/assume-role that referenced this issue Sep 6, 2017
ejholmes pushed a commit that referenced this issue Sep 6, 2017
Use $SHELL to distinguish bash running on Windows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants