diff --git a/config/scripts/.local/scripts/xgo b/config/scripts/.local/scripts/xgo index df69b81..3841953 100755 --- a/config/scripts/.local/scripts/xgo +++ b/config/scripts/.local/scripts/xgo @@ -10,7 +10,6 @@ import sys import tempfile import tarfile import zipfile -import requests from pathlib import Path DEFAULT_SHELL = "bash" @@ -19,6 +18,8 @@ SIZE_PATTERN = re.compile(r"^[1-9][0-9]*[KMGkmg]?$") def download_to(url: str, dest_dir: Path) -> Path: + # Import when needed + import requests local_filename = url.split('/')[-1] dest_path = dest_dir / local_filename @@ -120,7 +121,7 @@ def main(): parser.add_argument("--no-cleanup", "-n", action="store_true", help="Disable cleanup (unmount and remove dir)") args = parser.parse_args() - archive = args.archive.resolve() + archive = args.archive.strip() if archive.suffix in ['https://', 'http://']: archive = download_to(archive, Path.cwd())