Skip to content

Instantly share code, notes, and snippets.

@Wuvist
Created October 23, 2012 09:21
Show Gist options
  • Save Wuvist/3937826 to your computer and use it in GitHub Desktop.
Save Wuvist/3937826 to your computer and use it in GitHub Desktop.
#!/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)
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment