Rename 'rootDir' to 'srcDir'.
This commit is contained in:
parent
3ddb48bc08
commit
2b201feef6
1 changed files with 7 additions and 8 deletions
|
|
@ -18,7 +18,7 @@ type
|
||||||
installExt*: seq[string]
|
installExt*: seq[string]
|
||||||
requires*: seq[tuple[name: string, ver: PVersionRange]]
|
requires*: seq[tuple[name: string, ver: PVersionRange]]
|
||||||
bin*: seq[string]
|
bin*: seq[string]
|
||||||
rootDir*: string
|
srcDir*: string
|
||||||
|
|
||||||
TPackage* = object
|
TPackage* = object
|
||||||
name*: string
|
name*: string
|
||||||
|
|
@ -45,7 +45,7 @@ proc initPackageInfo(): TPackageInfo =
|
||||||
result.installExt = @[]
|
result.installExt = @[]
|
||||||
result.requires = @[]
|
result.requires = @[]
|
||||||
result.bin = @[]
|
result.bin = @[]
|
||||||
result.rootDir = ""
|
result.srcDir = ""
|
||||||
|
|
||||||
proc validatePackageInfo(pkgInfo: TPackageInfo, path: string) =
|
proc validatePackageInfo(pkgInfo: TPackageInfo, path: string) =
|
||||||
if pkgInfo.name == "":
|
if pkgInfo.name == "":
|
||||||
|
|
@ -95,7 +95,7 @@ proc readPackageInfo*(path: string): TPackageInfo =
|
||||||
of "author": result.author = ev.value
|
of "author": result.author = ev.value
|
||||||
of "description": result.description = ev.value
|
of "description": result.description = ev.value
|
||||||
of "license": result.license = ev.value
|
of "license": result.license = ev.value
|
||||||
of "rootdir": result.rootDir = ev.value
|
of "srcdir": result.srcDir = ev.value
|
||||||
of "skipdirs":
|
of "skipdirs":
|
||||||
result.skipDirs.add(ev.value.split(','))
|
result.skipDirs.add(ev.value.split(','))
|
||||||
of "skipfiles":
|
of "skipfiles":
|
||||||
|
|
@ -191,7 +191,6 @@ proc findBabelFile*(dir: string): string =
|
||||||
proc getPkgInfo*(dir: string): TPackageInfo =
|
proc getPkgInfo*(dir: string): TPackageInfo =
|
||||||
## Find the .babel file in ``dir`` and parses it, returning a TPackageInfo.
|
## Find the .babel file in ``dir`` and parses it, returning a TPackageInfo.
|
||||||
let babelFile = findBabelFile(dir)
|
let babelFile = findBabelFile(dir)
|
||||||
echo(dir)
|
|
||||||
if babelFile == "":
|
if babelFile == "":
|
||||||
raise newException(EBabel, "Specified directory does not contain a .babel file.")
|
raise newException(EBabel, "Specified directory does not contain a .babel file.")
|
||||||
result = readPackageInfo(babelFile)
|
result = readPackageInfo(babelFile)
|
||||||
|
|
@ -225,10 +224,10 @@ proc findPkg*(pkglist: seq[TPackageInfo],
|
||||||
result = true
|
result = true
|
||||||
|
|
||||||
proc getRealDir*(pkgInfo: TPackageInfo): string =
|
proc getRealDir*(pkgInfo: TPackageInfo): string =
|
||||||
## Returns the ``pkgInfo.rootDir`` or the .mypath directory if package does
|
## Returns the ``pkgInfo.srcDir`` or the .mypath directory if package does
|
||||||
## not specify the root dir.
|
## not specify the src dir.
|
||||||
if pkgInfo.rootDir != "":
|
if pkgInfo.srcDir != "":
|
||||||
result = pkgInfo.mypath.splitFile.dir / pkgInfo.rootDir
|
result = pkgInfo.mypath.splitFile.dir / pkgInfo.srcDir
|
||||||
else:
|
else:
|
||||||
result = pkgInfo.mypath.splitFile.dir
|
result = pkgInfo.mypath.splitFile.dir
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue