Created
October 23, 2012 09:21
-
-
Save Wuvist/3937826 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
#!/usr/bin/env python | |
import sys, os | |
import shutil | |
if len(sys.argv) < 2: | |
print "Usage: ./runsite.py venture" | |
sys.exit() | |
current_path = os.path.dirname(os.path.abspath(__file__)) + os.sep | |
config_files = [ | |
"alice/alice/protected/config/config.php", | |
"bob/application/configs/dev.ini", | |
"bob/application/configs/log.php" | |
] | |
def restore(venture): | |
for config_file in config_files: | |
name = config_file.split("/")[-1] | |
src = current_path + "_configs" + os.sep + venture + "_" + name | |
dest = current_path + "trunk" + os.sep + config_file.replace("/", os.sep) | |
shutil.copyfile(src, dest) | |
print "cp %s %s " % (src, dest) | |
venture = sys.argv[1].rstrip(os.sep) | |
restore(venture) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment