Don't search for nimscriptapi overrides. Fixes #306.
This commit is contained in:
parent
17f1467e5d
commit
4f175749e4
1 changed files with 6 additions and 26 deletions
|
|
@ -182,22 +182,6 @@ proc setupVM(module: PSym; scriptName: string,
|
||||||
if not flags.isNil:
|
if not flags.isNil:
|
||||||
flags[a.getString 0] = a.getString 1
|
flags[a.getString 0] = a.getString 1
|
||||||
|
|
||||||
proc findNimscriptApi(options: Options): string =
|
|
||||||
## Returns the directory containing ``nimscriptapi.nim`` or an empty string
|
|
||||||
## if it cannot be found.
|
|
||||||
result = ""
|
|
||||||
# Try finding it in exe's path
|
|
||||||
if fileExists(getAppDir() / "nimblepkg" / "nimscriptapi.nim"):
|
|
||||||
result = getAppDir()
|
|
||||||
|
|
||||||
if result.len == 0:
|
|
||||||
let pkgs = getInstalledPkgsMin(options.getPkgsDir(), options)
|
|
||||||
var pkg: PackageInfo
|
|
||||||
if pkgs.findPkg(("nimble", newVRAny()), pkg):
|
|
||||||
let pkgDir = pkg.getRealDir()
|
|
||||||
if fileExists(pkgDir / "nimblepkg" / "nimscriptapi.nim"):
|
|
||||||
result = pkgDir
|
|
||||||
|
|
||||||
proc getNimPrefixDir(): string = splitPath(findExe("nim")).head.parentDir
|
proc getNimPrefixDir(): string = splitPath(findExe("nim")).head.parentDir
|
||||||
|
|
||||||
when declared(ModuleGraph):
|
when declared(ModuleGraph):
|
||||||
|
|
@ -222,11 +206,7 @@ proc execScript(scriptName: string, flags: StringTableRef,
|
||||||
let pkgName = scriptName.splitFile.name
|
let pkgName = scriptName.splitFile.name
|
||||||
|
|
||||||
# Ensure that "nimblepkg/nimscriptapi" is in the PATH.
|
# Ensure that "nimblepkg/nimscriptapi" is in the PATH.
|
||||||
let nimscriptApiPath = findNimscriptApi(options)
|
# TODO: put this in a more isolated directory.
|
||||||
if nimscriptApiPath.len > 0:
|
|
||||||
# TODO: Once better output is implemented show a message here.
|
|
||||||
appendStr(searchPaths, nimscriptApiPath)
|
|
||||||
else:
|
|
||||||
let tmpNimscriptApiPath = getTempDir() / "nimblepkg" / "nimscriptapi.nim"
|
let tmpNimscriptApiPath = getTempDir() / "nimblepkg" / "nimscriptapi.nim"
|
||||||
createDir(tmpNimscriptApiPath.splitFile.dir)
|
createDir(tmpNimscriptApiPath.splitFile.dir)
|
||||||
if not existsFile(tmpNimscriptApiPath):
|
if not existsFile(tmpNimscriptApiPath):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue