Atlas: added 'extract' command, as promised (#18813)
This commit is contained in:
parent
73841ae194
commit
cc5422ae50
1 changed files with 9 additions and 1 deletions
|
|
@ -9,7 +9,7 @@
|
|||
## Simple tool to automate frequent workflows: Can "clone"
|
||||
## a Nimble dependency and its dependencies recursively.
|
||||
|
||||
import std/[parseopt, strutils, os, osproc, unicode, tables, sets]
|
||||
import std/[parseopt, strutils, os, osproc, unicode, tables, sets, json, jsonutils]
|
||||
import parse_requires, osutils, packagesjson
|
||||
|
||||
const
|
||||
|
|
@ -22,6 +22,8 @@ Usage:
|
|||
Command:
|
||||
clone url|pkgname clone a package and all of its dependencies
|
||||
search keyw keywB... search for package that contains the given keywords
|
||||
extract file.nimble extract the requirements and custom commands from
|
||||
the given Nimble file
|
||||
|
||||
Options:
|
||||
--keepCommits do not perform any `git checkouts`
|
||||
|
|
@ -460,6 +462,12 @@ proc main =
|
|||
of "search", "list":
|
||||
updatePackages(c)
|
||||
search getPackages(c.workspace), args
|
||||
of "extract":
|
||||
singleArg()
|
||||
if fileExists(args[0]):
|
||||
echo toJson(extractRequiresInfo(args[0]))
|
||||
else:
|
||||
error "File does not exist: " & args[0]
|
||||
else:
|
||||
error "Invalid action: " & action
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue