Permalink
Browse files

Add work dir setting

  • Loading branch information...
1 parent 39901ce commit 7c0ef75bde2e4ba12dd77a47ce96f4c92baeea41 Anton Grudko committed Nov 12, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 n3d.py
View
8 n3d.py
@@ -282,6 +282,9 @@ def main():
optionparser.add_option("-s", "--stages-dir", dest="stages_dir",
default=os.path.join("deploy","stages"),
help="stages root directory [ default: %default ]")
+ optionparser.add_option("-w", "--work-dir", dest="work_dir",
+ default="deploy",
+ help="working directory [ default: %default ]")
optionparser.add_option("-l", "--log-file", dest="log_file",
default="./deploy_process.log",
help="log file [ default: %default ]")
@@ -297,7 +300,10 @@ def main():
if not os.path.exists(options.stages_dir):
print "Stages directory not found: %s" % options.stages_dir
sys.exit(1)
-
+ if not os.path.exists(options.work_dir):
+ print "Working directory not found: %s" % options.work_dir
+ sys.exit(1)
+ os.chdir(options.work_dir)
logging.basicConfig(filename=options.log_file,
format='%(asctime)s %(message)s',
level=logging.DEBUG)

0 comments on commit 7c0ef75

Please sign in to comment.