Skip to content

Commit 71da4fc

Browse files
author
SamCHogg
committed
Add an optional flag to update which disables checking for requirements
1 parent b35d117 commit 71da4fc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

mbed/mbed.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ def check_requirements(self, show_warning=False):
15191519

15201520

15211521
# Routines after cloning mbed-os
1522-
def post_action(self):
1522+
def post_action(self, check_reqs=True):
15231523
mbed_tools_path = self.get_tools_dir()
15241524

15251525
if not mbed_tools_path and self.is_classic:
@@ -1534,7 +1534,8 @@ def post_action(self):
15341534
os.path.isfile(os.path.join(mbed_tools_path, 'default_settings.py'))):
15351535
shutil.copy(os.path.join(mbed_tools_path, 'default_settings.py'), os.path.join(self.path, 'mbed_settings.py'))
15361536

1537-
self.check_requirements(True)
1537+
if check_reqs:
1538+
self.check_requirements(True)
15381539

15391540
def add_tools(self, path):
15401541
if not os.path.exists(path):
@@ -2177,13 +2178,14 @@ def publish(all_refs=None, msg=None, top=True):
21772178
dict(name='--insecure', action='store_true', help='Allow insecure repository URLs. By default mbed CLI imports only "safe" URLs, e.g. based on standard ports - 80, 443 and 22. This option enables the use of arbitrary URLs/ports.'),
21782179
dict(name='--offline', action='store_true', help='Offline mode will force the use of locally cached repositories and prevent requests to remote repositories.'),
21792180
dict(name=['-l', '--latest-deps'], action='store_true', help='Update all dependencies to the latest revision of their current branch. WARNING: Ignores lib files'),
2181+
dict(name='--no-requirements', action='store_true', help='Disables checking for and installing any requirements.'),
21802182
hidden_aliases=['up'],
21812183
help='Update to branch, tag, revision or latest',
21822184
description=(
21832185
"Updates the current program or library and its dependencies to specified\nbranch, tag or revision.\n"
21842186
"Alternatively fetches from associated remote repository URL and updates to the\n"
21852187
"latest revision in the current branch."))
2186-
def update(rev=None, clean=False, clean_files=False, clean_deps=False, ignore=False, depth=None, protocol=None, insecure=False, offline=False, latest_deps=False, top=True):
2188+
def update(rev=None, clean=False, clean_files=False, clean_deps=False, ignore=False, depth=None, protocol=None, insecure=False, offline=False, latest_deps=False, no_requirements=False, top=True):
21872189
offline_warning(offline, top)
21882190

21892191
if top and clean:
@@ -2284,7 +2286,7 @@ def update(rev=None, clean=False, clean_files=False, clean_deps=False, ignore=Fa
22842286
if top:
22852287
program = Program(repo.path)
22862288
program.set_root()
2287-
program.post_action()
2289+
program.post_action(not no_requirements)
22882290
if program.is_classic:
22892291
program.update_tools(os.path.join(getcwd(), '.temp'))
22902292

0 commit comments

Comments
 (0)