File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import os
12from cfbs .commands import generate_release_information_command
23from cfengine_cli .utils import UserError
34from cfengine_cli .dependency_tables import update_dependency_tables
@@ -12,36 +13,39 @@ def _continue_prompt() -> bool:
1213 return answer in ("y" , "yes" )
1314
1415
15- def _repo_notice (repo ) -> bool :
16+ def _expect_repo (repo ) -> bool :
17+ cwd = os .getcwd ()
18+ if cwd .endswith (repo ):
19+ return True
1620 print (f"Note: This command is intended to be run in the { repo } repo" )
1721 print (f" https://github.com/cfengine/{ repo } " )
1822 answer = _continue_prompt ()
1923 return answer
2024
2125
2226def dependency_tables () -> int :
23- answer = _repo_notice ("buildscripts" )
27+ answer = _expect_repo ("buildscripts" )
2428 if answer :
2529 return update_dependency_tables ()
2630 return 1
2731
2832
2933def docs_format () -> int :
30- answer = _repo_notice ("documentation" )
34+ answer = _expect_repo ("documentation" )
3135 if answer :
3236 return update_docs ()
3337 return 1
3438
3539
3640def docs_check () -> int :
37- answer = _repo_notice ("documentation" )
41+ answer = _expect_repo ("documentation" )
3842 if answer :
3943 return check_docs ()
4044 return 1
4145
4246
4347def release_information () -> int :
44- answer = _repo_notice ("release-information" )
48+ answer = _expect_repo ("release-information" )
4549 if answer :
4650 generate_release_information_command ()
4751 return 0
You can’t perform that action at this time.
0 commit comments