Skip to content
Open
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
9 changes: 8 additions & 1 deletion src/nimblepkg/download.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand Down