File tree Expand file tree Collapse file tree
remove-json-keys/src/remove_json_keys/lib
translate-messages/src/translate_messages/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,11 +14,12 @@ def cli():
1414def config_file (cli ):
1515 target_path = Path .cwd () / f'.{ cli .short_name } .config.json5'
1616 project_markers = data .json .read (data_path / 'project_markers.json' )
17+ in_project_root = None
1718 if not any ((Path .cwd () / marker ).exists () for marker in project_markers ):
1819 log .warn (f'{ cli .msgs .warn_NO_PROJECT_ROOT_FOUND_IN } { Path .cwd ()} ' )
1920 user_resp = input (f'{ cli .msgs .prompt_INIT_CONFIG_HERE_ANYWAY } ? (y/N): ' ).strip ().lower ()
2021 if not user_resp .startswith ('y' ) : return
21- else : not_in_root = True # for move tip
22+ else : in_project_root = True # for move tip
2223
2324 # Handle existing file
2425 if target_path .exists ():
@@ -34,7 +35,7 @@ def config_file(cli):
3435 cli .default_file_config = data .url .get (f'{ cli .urls .jsdelivr } /{ cli .name } /{ target_path .name } ' )
3536 data .file .write (str (target_path ), cli .default_file_config )
3637 log .success (f'{ cli .msgs .log_DEFAULT_CONFIG_CREATED_AT } { target_path } ' )
37- if not_in_root : log .tip (f'{ cli .msgs .tip_MOVE_CONFIG_TO_ROOT } .' )
38+ if in_project_root : log .tip (f'{ cli .msgs .tip_MOVE_CONFIG_TO_ROOT } .' )
3839
3940def config_filepath (cli ): # for settings.load()
4041
Original file line number Diff line number Diff line change @@ -14,11 +14,12 @@ def cli():
1414def config_file (cli ):
1515 target_path = Path .cwd () / f'.{ cli .short_name } .config.json5'
1616 project_markers = data .json .read (data_path / 'project_markers.json' )
17+ in_project_root = None
1718 if not any ((Path .cwd () / marker ).exists () for marker in project_markers ):
1819 log .warn (f'{ cli .msgs .warn_NO_PROJECT_ROOT_FOUND_IN } { Path .cwd ()} ' )
1920 user_resp = input (f'{ cli .msgs .prompt_INIT_CONFIG_HERE_ANYWAY } ? (y/N): ' ).strip ().lower ()
2021 if not user_resp .startswith ('y' ) : return
21- else : not_in_root = True # for move tip
22+ else : in_project_root = True # for move tip
2223
2324 # Handle existing file
2425 if target_path .exists ():
@@ -34,7 +35,7 @@ def config_file(cli):
3435 cli .default_file_config = data .url .get (f'{ cli .urls .jsdelivr } /{ cli .name } /{ target_path .name } ' )
3536 data .file .write (str (target_path ), cli .default_file_config )
3637 log .success (f'{ cli .msgs .log_DEFAULT_CONFIG_CREATED_AT } { target_path } ' )
37- if not_in_root : log .tip (f'{ cli .msgs .tip_MOVE_CONFIG_TO_ROOT } .' )
38+ if in_project_root : log .tip (f'{ cli .msgs .tip_MOVE_CONFIG_TO_ROOT } .' )
3839
3940def config_filepath (cli ): # for settings.load()
4041
You can’t perform that action at this time.
0 commit comments