diff --git a/src/nimblepkg/download.nim b/src/nimblepkg/download.nim index 86381df02..82849eaa6 100644 --- a/src/nimblepkg/download.nim +++ b/src/nimblepkg/download.nim @@ -531,15 +531,19 @@ proc getDevelopDownloadDir*(url, subdir: string, options: Options): string = let url = url.removeTrailingSlash let subdir = subdir.removeTrailingSlash + let uri = parseUri(url) + let downloadDirName = if subdir.len == 0: - parseUri(url).path.splitFile.name + uri.path.splitFile.name else: subdir.splitFile.name result = if options.action.path.isAbsolute: options.action.path / downloadDirName + elif options.action.withDependencies and uri.scheme == "file": + uri.path else: getCurrentDir() / options.action.path / downloadDirName @@ -577,6 +581,9 @@ proc getDownloadInfo*(pv: PkgTuple, options: Options, if pv.name.isURL: let (url, metadata) = getUrlData(pv.name) return (checkUrlType(url), url, metadata) + elif dirExists(pv.name): + let (url, metadata) = getUrlData("file://" & expandFilename(pv.name)) + return (checkUrlType(url), url, metadata) else: var pkg = initPackage() if getPackage(pv.name, options, pkg, ignorePackageCache):