diff --git a/wnf.py b/wnf.py index 6628eafe4f..7e16371e5f 100755 --- a/wnf.py +++ b/wnf.py @@ -232,8 +232,7 @@ def setup_options(): nargs=2, metavar="ORIGIN BRANCH") parser.add_option("--patch_sync_build", - help="run latest patches, sync all and rebuild js css", - nargs=2, metavar="ORIGIN BRANCH") + help="run latest patches, sync all and rebuild js css") parser.add_option("--cleanup_data", help="Cleanup test data", default=False, action="store_true") @@ -253,12 +252,43 @@ def run(): sys.path.append('.') sys.path.append('lib') sys.path.append('app') - import webnotes - import conf (options, args) = setup_options() + + # build + if options.build: + from webnotes.utils import bundlejs + bundlejs.bundle(options.no_compress) + return + elif options.watch: + from webnotes.utils import bundlejs + bundlejs.watch(options.no_compress) + return + # code replace + elif options.replace: + print options.replace + replace_code('.', options.replace[0], options.replace[1], options.replace[2], force=options.force) + return + + # git + elif options.status: + os.chdir('lib') + os.system('git status') + os.chdir('../app') + os.system('git status') + return + + elif options.git: + os.chdir('lib') + os.system('git %s' % options.git) + os.chdir('../app') + os.system('git %s' % options.git) + return + + import webnotes + import conf from webnotes.db import Database import webnotes.modules.patch_handler @@ -271,33 +301,6 @@ def run(): elif not any([options.install, options.pull]): webnotes.connect(conf.db_name) - # build - if options.build: - from webnotes.utils import bundlejs - bundlejs.bundle(options.no_compress) - - if options.watch: - from webnotes.utils import bundlejs - bundlejs.watch(options.no_compress) - - # code replace - elif options.replace: - print options.replace - replace_code('.', options.replace[0], options.replace[1], options.replace[2], force=options.force) - - # git - elif options.status: - os.chdir('lib') - os.system('git status') - os.chdir('../app') - os.system('git status') - - elif options.git: - os.chdir('lib') - os.system('git %s' % options.git) - os.chdir('../app') - os.system('git %s' % options.git) - elif options.pull: pull(options.pull[0], options.pull[1], build=True)