Fixes cloning repo for develop command.
This commit is contained in:
parent
bdfb681824
commit
acbce88bac
3 changed files with 18 additions and 2 deletions
|
|
@ -926,13 +926,21 @@ proc developFromDir(dir: string, options: Options) =
|
||||||
# processDeps).
|
# processDeps).
|
||||||
saveNimbleData(options)
|
saveNimbleData(options)
|
||||||
|
|
||||||
|
display("Success:", (pkgInfo.name & " linked successfully to '$1'.") %
|
||||||
|
dir, Success, HighPriority)
|
||||||
|
|
||||||
proc develop(options: Options) =
|
proc develop(options: Options) =
|
||||||
if options.action.packages == @[]:
|
if options.action.packages == @[]:
|
||||||
developFromDir(getCurrentDir(), options)
|
developFromDir(getCurrentDir(), options)
|
||||||
else:
|
else:
|
||||||
# Install each package.
|
# Install each package.
|
||||||
for pv in options.action.packages:
|
for pv in options.action.packages:
|
||||||
let downloadDir = getCurrentDir() / pv.name
|
let name =
|
||||||
|
if isURL(pv.name):
|
||||||
|
parseUri(pv.name).path
|
||||||
|
else:
|
||||||
|
pv.name
|
||||||
|
let downloadDir = getCurrentDir() / name
|
||||||
if dirExists(downloadDir):
|
if dirExists(downloadDir):
|
||||||
let msg = "Cannot clone into '$1': directory exists." % downloadDir
|
let msg = "Cannot clone into '$1': directory exists." % downloadDir
|
||||||
let hint = "Remove the directory, or run this command somewhere else."
|
let hint = "Remove the directory, or run this command somewhere else."
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,7 @@ proc parseArgument*(key: string, result: var Options) =
|
||||||
case result.action.typ
|
case result.action.typ
|
||||||
of actionNil:
|
of actionNil:
|
||||||
assert false
|
assert false
|
||||||
of actionInstall, actionPath, actionUninstall:
|
of actionInstall, actionPath, actionDevelop, actionUninstall:
|
||||||
# Parse pkg@verRange
|
# Parse pkg@verRange
|
||||||
if '@' in key:
|
if '@' in key:
|
||||||
let i = find(key, '@')
|
let i = find(key, '@')
|
||||||
|
|
|
||||||
|
|
@ -518,3 +518,11 @@ suite "develop feature":
|
||||||
checkpoint(output)
|
checkpoint(output)
|
||||||
check exitCode == QuitSuccess
|
check exitCode == QuitSuccess
|
||||||
check(not output.processOutput.inLines("warning"))
|
check(not output.processOutput.inLines("warning"))
|
||||||
|
|
||||||
|
test "can git clone for develop":
|
||||||
|
let cloneDir = installDir / "developTmp"
|
||||||
|
createDir(cloneDir)
|
||||||
|
cd cloneDir:
|
||||||
|
let url = "https://github.com/nimble-test/packagea.git"
|
||||||
|
let (output, exitCode) = execNimble("develop", "-y", url)
|
||||||
|
check exitCode == QuitSuccess
|
||||||
Loading…
Add table
Add a link
Reference in a new issue