a better message if graphviz's dot/nodejs is not found in PATH (#21488)
* finish issue #21474: a better message if dot is not found locally when using gendepend * fix a typo in compiler * trim empty path reported in `findNodeJs` * compiler/main.nim: switch raise to simply quit
This commit is contained in:
parent
2f89f1eb78
commit
8e9fc5e639
2 changed files with 8 additions and 1 deletions
|
|
@ -71,6 +71,13 @@ proc commandGenDepend(graph: ModuleGraph) =
|
|||
let project = graph.config.projectFull
|
||||
writeDepsFile(graph)
|
||||
generateDot(graph, project)
|
||||
|
||||
# dot in graphivz tool kit is required
|
||||
let graphvizDotPath = findExe("dot")
|
||||
if graphvizDotPath.len == 0:
|
||||
quit("gendepend: Graphviz's tool dot is required," &
|
||||
"see https://graphviz.org/download for downloading")
|
||||
|
||||
execExternalProgram(graph.config, "dot -Tpng -o" &
|
||||
changeFileExt(project, "png").string &
|
||||
' ' & changeFileExt(project, "dot").string)
|
||||
|
|
|
|||
|
|
@ -7,4 +7,4 @@ proc findNodeJs*(): string {.inline.} =
|
|||
result = findExe("node")
|
||||
if result.len == 0:
|
||||
echo "Please install NodeJS first, see https://nodejs.org/en/download"
|
||||
raise newException(IOError, "NodeJS not found in PATH: " & result)
|
||||
raise newException(IOError, "NodeJS not found in PATH")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue