mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-29 20:34:22 +01:00
Updated for exception
This commit is contained in:
parent
e0f8789061
commit
7e125ecc1b
1 changed files with 6 additions and 2 deletions
|
@ -53,8 +53,12 @@ class Downloader(Configs):
|
|||
filename: str = unquote(Path(path).name)
|
||||
|
||||
if url.startswith('file'):
|
||||
shutil.copy2(Path(url.replace('file:', '')), self.tmp_slpkg)
|
||||
print(f"{self.byellow}Copying{self.endc}: {Path(url.replace('file:', ''))} -> {self.tmp_slpkg}\n")
|
||||
try:
|
||||
shutil.copy2(Path(url.replace('file:', '')), self.tmp_slpkg)
|
||||
print(f"{self.byellow}Copying{self.endc}: {Path(url.replace('file:', ''))} -> {self.tmp_slpkg}")
|
||||
except FileNotFoundError as error:
|
||||
self.errors.raise_error_message(f'{error}', 20)
|
||||
|
||||
else:
|
||||
if self.downloader in ['wget', 'wget2']:
|
||||
command: str = f'{self.downloader} {self.wget_options} --directory-prefix={self.path} "{url}"'
|
||||
|
|
Loading…
Add table
Reference in a new issue