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"
|
## Simple tool to automate frequent workflows: Can "clone"
|
||||||
## a Nimble dependency and its dependencies recursively.
|
## 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
|
import parse_requires, osutils, packagesjson
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
@ -22,6 +22,8 @@ Usage:
|
||||||
Command:
|
Command:
|
||||||
clone url|pkgname clone a package and all of its dependencies
|
clone url|pkgname clone a package and all of its dependencies
|
||||||
search keyw keywB... search for package that contains the given keywords
|
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:
|
Options:
|
||||||
--keepCommits do not perform any `git checkouts`
|
--keepCommits do not perform any `git checkouts`
|
||||||
|
|
@ -460,6 +462,12 @@ proc main =
|
||||||
of "search", "list":
|
of "search", "list":
|
||||||
updatePackages(c)
|
updatePackages(c)
|
||||||
search getPackages(c.workspace), args
|
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:
|
else:
|
||||||
error "Invalid action: " & action
|
error "Invalid action: " & action
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue