Created
February 26, 2020 08:15
-
-
Save gmariette/792001e981b865a22809c09a2eb91b07 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dumpedInstancesByEnv = json.dumps(instancesByEnv, indent=4) | |
| f=open("/home/youruser/env_status.json", "w+") | |
| f.write(dumpedInstancesByEnv) | |
| f.close() | |
| bashprofile = open("/home/youruser/.bash_profile", "a+") | |
| bashprofileLines = bashprofile.readlines() | |
| for line in bashprofileLines: | |
| if "env_status.json" in line: | |
| print("bash_profile already sourcing env_status.json") | |
| found = True | |
| else: | |
| found = False | |
| if not found: | |
| bashprofile.write('cat /home/youruser/env_status.json \n') | |
| bashprofile.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment