Skip to content

Commit 0cad60a

Browse files
committed
Always checkout the latest mbed-os release marked with tag latest (#330)
1 parent a3fcfd0 commit 0cad60a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mbed/mbed.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1570,11 +1570,15 @@ def new(name, scm='git', program=False, library=False, mbedlib=False, create_onl
15701570
p.set_root()
15711571
if not create_only and not p.get_os_dir() and not p.get_mbedlib_dir():
15721572
url = mbed_lib_url if mbedlib else mbed_os_url
1573+
d = 'mbed' if mbedlib else 'mbed-os'
15731574
try:
15741575
with cd(d_path):
15751576
add(url, depth=depth, protocol=protocol, top=False)
1577+
if not mbedlib:
1578+
with cd(d):
1579+
repo = Repo.fromrepo()
1580+
repo.checkout('latest')
15761581
except Exception as e:
1577-
d = 'mbed' if mbedlib else 'mbed-os'
15781582
if os.path.isdir(os.path.join(d_path, d)):
15791583
rmtree_readonly(os.path.join(d_path, d))
15801584
raise e

0 commit comments

Comments
 (0)