Last active
May 8, 2018 19:47
-
-
Save tlugger/2da9c8e615265243c07c76549f402ca6 to your computer and use it in GitHub Desktop.
This file contains 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
# A script to move instance environment variables from nio.env to the new nio.conf [user_defined]section. | |
# Useful for migrating a project from nio-core < 20170126 | |
# | |
# Usage: | |
# Run this script from inside the project root | |
# | |
# Example: | |
# python move-conf.py | |
# | |
# All variables set in nio.env will now show up at the bottom of nio.conf in a [user_defined] section | |
with open('nio.conf', 'a') as nconf, open('nio.env', 'r') as nenv: | |
for line in nenv: | |
if '[vars]' in line: | |
nconf.write('\n[user_defined]\n') | |
else: | |
conf_line = line.replace(': ', '=') | |
nconf.write(conf_line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment