Path substitution for --out and --outdir (#12796)
* Enable pathSubs for --out and --outDir * Cleanup
This commit is contained in:
parent
9e1fd9e46b
commit
eed328856f
2 changed files with 4 additions and 6 deletions
|
|
@ -392,15 +392,15 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
|
||||||
conf.lazyPaths.keepItIf(it != path)
|
conf.lazyPaths.keepItIf(it != path)
|
||||||
of "nimcache":
|
of "nimcache":
|
||||||
expectArg(conf, switch, arg, pass, info)
|
expectArg(conf, switch, arg, pass, info)
|
||||||
conf.nimcacheDir = processPath(conf, arg, info, true)
|
conf.nimcacheDir = processPath(conf, arg, info, notRelativeToProj=true)
|
||||||
of "out", "o":
|
of "out", "o":
|
||||||
expectArg(conf, switch, arg, pass, info)
|
expectArg(conf, switch, arg, pass, info)
|
||||||
let f = splitFile(arg.expandTilde)
|
let f = splitFile(processPath(conf, arg, info, notRelativeToProj=true).string)
|
||||||
conf.outFile = RelativeFile f.name & f.ext
|
conf.outFile = RelativeFile f.name & f.ext
|
||||||
conf.outDir = toAbsoluteDir f.dir
|
conf.outDir = toAbsoluteDir f.dir
|
||||||
of "outdir":
|
of "outdir":
|
||||||
expectArg(conf, switch, arg, pass, info)
|
expectArg(conf, switch, arg, pass, info)
|
||||||
conf.outDir = toAbsoluteDir arg.expandTilde
|
conf.outDir = processPath(conf, arg, info, notRelativeToProj=true)
|
||||||
of "docseesrcurl":
|
of "docseesrcurl":
|
||||||
expectArg(conf, switch, arg, pass, info)
|
expectArg(conf, switch, arg, pass, info)
|
||||||
conf.docSeeSrcUrl = arg
|
conf.docSeeSrcUrl = arg
|
||||||
|
|
|
||||||
|
|
@ -586,9 +586,7 @@ proc pathSubs*(conf: ConfigRef; p, config: string): string =
|
||||||
"projectname", conf.projectName,
|
"projectname", conf.projectName,
|
||||||
"projectpath", conf.projectPath.string,
|
"projectpath", conf.projectPath.string,
|
||||||
"projectdir", conf.projectPath.string,
|
"projectdir", conf.projectPath.string,
|
||||||
"nimcache", getNimcacheDir(conf).string])
|
"nimcache", getNimcacheDir(conf).string]).expandTilde
|
||||||
if "~/" in result:
|
|
||||||
result = result.replace("~/", home & '/')
|
|
||||||
|
|
||||||
iterator nimbleSubs*(conf: ConfigRef; p: string): string =
|
iterator nimbleSubs*(conf: ConfigRef; p: string): string =
|
||||||
let pl = p.toLowerAscii
|
let pl = p.toLowerAscii
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue