mirror of
https://github.com/netbox-community/Device-Type-Library-Import.git
synced 2025-01-09 06:58:30 +01:00
Update output messages with git remote and local path
so it's clear what data is being used if a non-default git url is specified
This commit is contained in:
parent
0d9773c0e0
commit
00e9b3d73f
@ -17,7 +17,7 @@ def update_package(path: str):
|
||||
repo = Repo(path)
|
||||
if repo.remotes.origin.url.endswith('.git'):
|
||||
repo.remotes.origin.pull()
|
||||
print("Pulled Repo")
|
||||
print(f"Pulled Repo {repo.remotes.origin.url}")
|
||||
except exc.InvalidGitRepositoryError:
|
||||
pass
|
||||
|
||||
@ -245,12 +245,11 @@ def createDeviceTypes(deviceTypes, nb):
|
||||
|
||||
try:
|
||||
if os.path.isdir('./repo'):
|
||||
msg = 'Package devicetype-library is already installed, updating'
|
||||
print(f"Package devicetype-library is already installed, updating {os.path.join(cwd, 'repo')}")
|
||||
update_package('./repo')
|
||||
print(msg)
|
||||
else:
|
||||
repo = Repo.clone_from(args.url, os.path.join(cwd, 'repo'))
|
||||
print("Package Installed")
|
||||
print(f"Package Installed {repo.remotes.origin.url}")
|
||||
except exc.GitCommandError as error:
|
||||
print("Couldn't clone {} ({})".format(args.url, error))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user