mozilla-aws-cli icon indicating copy to clipboard operation
mozilla-aws-cli copied to clipboard

In Windows, don't echo out "SET ..." commands, instead set environment variables from within Python

Open gene1wood opened this issue 4 years ago • 4 comments

Since there's no easy way to eval in cmd.exe instead of outputting SET AWS_.... just set the environment variables inside Python (shutil.command("setx foo=bar")).

This adds them to the global OS wise environment variable namespace. It doesn't however update the current cmd.exe that you're in.

gene1wood avatar Aug 06 '20 15:08 gene1wood

Is this actually the right thing to do, though? I'm not certain if this is a good idea, or if we should simply tell people that only awscli and envvar as text output works in a cmd terminal.

april avatar Aug 06 '20 17:08 april

I think we can make it an option for users. We can even echo out from maws (in windows) something like "your environment has been update. this cmd.exe window however has not"

I don't think the "print something out and expect the user to copy paste it back into their console" is a path we want to offer

gene1wood avatar Aug 06 '20 17:08 gene1wood

Yes, but that's a considerable amount of work for a small group of people clinging to an ancient subsystem. I almost think it would be better to simply say to use Powershell instead.

april avatar Aug 06 '20 18:08 april

And even if we did do it, the best case scenario is that you have to close your existing window and open a new command window. That is pretty darned ugly.

april avatar Aug 06 '20 18:08 april