From 0c255b2f96d2c001351f443bbfc3aff3f462267d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Sun, 24 Jul 2016 14:52:21 +0530 Subject: [PATCH] [fix] set all patches as executed on bench init --- bench/patches/__init__.py | 8 ++++++++ bench/utils.py | 2 ++ 2 files changed, 10 insertions(+) diff --git a/bench/patches/__init__.py b/bench/patches/__init__.py index 5a504737..b80170a1 100644 --- a/bench/patches/__init__.py +++ b/bench/patches/__init__.py @@ -29,3 +29,11 @@ def run(bench_path): # end with an empty line f.write('\n') + +def set_all_patches_executed(bench_path): + source_patch_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'patches.txt') + target_patch_file = os.path.join(os.path.abspath(bench_path), 'patches.txt') + + with open(target_patch_file, 'w') as tf: + with open(source_patch_file, 'r') as sf: + tf.write(sf.read()) diff --git a/bench/utils.py b/bench/utils.py index 289bf885..d5ec9d31 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -30,6 +30,7 @@ def init(path, apps_path=None, no_procfile=False, no_backups=False, from .config.common_site_config import make_config from .config import redis from .config.procfile import setup_procfile + from bench.patches import set_all_patches_executed if os.path.exists(path): print 'Directory {} already exists!'.format(path) @@ -58,6 +59,7 @@ def init(path, apps_path=None, no_procfile=False, no_backups=False, if bench.FRAPPE_VERSION > 5: setup_socketio(bench_path=path) + set_all_patches_executed(bench_path=path) build_assets(bench_path=path) redis.generate_config(path)