diff --git a/src/nimble.nim b/src/nimble.nim index e7058f1..38fef3a 100644 --- a/src/nimble.nim +++ b/src/nimble.nim @@ -926,13 +926,21 @@ proc developFromDir(dir: string, options: Options) = # processDeps). saveNimbleData(options) + display("Success:", (pkgInfo.name & " linked successfully to '$1'.") % + dir, Success, HighPriority) + proc develop(options: Options) = if options.action.packages == @[]: developFromDir(getCurrentDir(), options) else: # Install each package. 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): let msg = "Cannot clone into '$1': directory exists." % downloadDir let hint = "Remove the directory, or run this command somewhere else." diff --git a/src/nimblepkg/options.nim b/src/nimblepkg/options.nim index 5890a00..ae2cdb2 100644 --- a/src/nimblepkg/options.nim +++ b/src/nimblepkg/options.nim @@ -219,7 +219,7 @@ proc parseArgument*(key: string, result: var Options) = case result.action.typ of actionNil: assert false - of actionInstall, actionPath, actionUninstall: + of actionInstall, actionPath, actionDevelop, actionUninstall: # Parse pkg@verRange if '@' in key: let i = find(key, '@') diff --git a/tests/tester.nim b/tests/tester.nim index ad8906a..0732177 100644 --- a/tests/tester.nim +++ b/tests/tester.nim @@ -518,3 +518,11 @@ suite "develop feature": checkpoint(output) check exitCode == QuitSuccess 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 \ No newline at end of file