parent
a262a87bbe
commit
7c3c61f2f1
3 changed files with 18 additions and 1 deletions
|
|
@ -1112,6 +1112,8 @@ proc processArgument*(pass: TCmdLinePass; p: OptParser;
|
||||||
else:
|
else:
|
||||||
if pass == passCmd1: config.commandArgs.add p.key
|
if pass == passCmd1: config.commandArgs.add p.key
|
||||||
if argsCount == 1:
|
if argsCount == 1:
|
||||||
|
if p.key.endsWith(".nims"):
|
||||||
|
incl(config.globalOptions, optWasNimscript)
|
||||||
# support UNIX style filenames everywhere for portable build scripts:
|
# support UNIX style filenames everywhere for portable build scripts:
|
||||||
if config.projectName.len == 0:
|
if config.projectName.len == 0:
|
||||||
config.projectName = unixToNativePath(p.key)
|
config.projectName = unixToNativePath(p.key)
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,9 @@ proc commandCheck(graph: ModuleGraph) =
|
||||||
let conf = graph.config
|
let conf = graph.config
|
||||||
conf.setErrorMaxHighMaybe
|
conf.setErrorMaxHighMaybe
|
||||||
defineSymbol(conf.symbols, "nimcheck")
|
defineSymbol(conf.symbols, "nimcheck")
|
||||||
|
if optWasNimscript in conf.globalOptions:
|
||||||
|
defineSymbol(conf.symbols, "nimscript")
|
||||||
|
defineSymbol(conf.symbols, "nimconfig")
|
||||||
semanticPasses(graph) # use an empty backend for semantic checking only
|
semanticPasses(graph) # use an empty backend for semantic checking only
|
||||||
compileProject(graph)
|
compileProject(graph)
|
||||||
|
|
||||||
|
|
@ -367,7 +370,8 @@ proc mainCommand*(graph: ModuleGraph) =
|
||||||
msgWriteln(conf, "-- end of list --", {msgStdout, msgSkipHook})
|
msgWriteln(conf, "-- end of list --", {msgStdout, msgSkipHook})
|
||||||
|
|
||||||
for it in conf.searchPaths: msgWriteln(conf, it.string)
|
for it in conf.searchPaths: msgWriteln(conf, it.string)
|
||||||
of cmdCheck: commandCheck(graph)
|
of cmdCheck:
|
||||||
|
commandCheck(graph)
|
||||||
of cmdParse:
|
of cmdParse:
|
||||||
wantMainModule(conf)
|
wantMainModule(conf)
|
||||||
discard parseFile(conf.projectMainIdx, cache, conf)
|
discard parseFile(conf.projectMainIdx, cache, conf)
|
||||||
|
|
|
||||||
11
tests/newconfig/tconfigcheck.nims
Normal file
11
tests/newconfig/tconfigcheck.nims
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
discard """
|
||||||
|
cmd: "nim check $file"
|
||||||
|
"""
|
||||||
|
|
||||||
|
mode = ScriptMode.Verbose
|
||||||
|
proc build() =
|
||||||
|
echo "building nim... "
|
||||||
|
exec "sleep 10"
|
||||||
|
echo getCurrentDir()
|
||||||
|
|
||||||
|
echo "hello"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue