Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions mbed/mbed.py
Original file line number Diff line number Diff line change
Expand Up @@ -1731,6 +1731,7 @@ def import_(url, path=None, ignore=False, depth=None, protocol=None, top=True):
global cwd_root

# translate 'mbed-os' to https://github.com/ARMmbed/mbed-os
orig_url = url
if not Repo.isurl(url) and not os.path.exists(url):
url = mbed_base_url+'/'+url

Expand All @@ -1746,6 +1747,9 @@ def import_(url, path=None, ignore=False, depth=None, protocol=None, top=True):
if os.path.isdir(repo.path) and len(os.listdir(repo.path)) > 1:
error("Directory \"%s\" is not empty. Please ensure that the destination folder is empty." % repo.path, 1)

if not Repo.isurl(orig_url) and os.path.exists(orig_url):
warning("Importing from a local folder \"%s\", not from a URL" % orig_url)

text = "Importing program" if top else "Adding library"
action("%s \"%s\" from \"%s\"%s" % (text, relpath(cwd_root, repo.path), formaturl(repo.url, protocol), ' at '+(repo.revtype(repo.rev, True))))
if repo.clone(repo.url, repo.path, rev=repo.rev, depth=depth, protocol=protocol):
Expand Down