diff options
author | Andreas Rumpf <andreasrumpf@noname> | 2009-09-23 23:38:00 +0200 |
---|---|---|
committer | Andreas Rumpf <andreasrumpf@noname> | 2009-09-23 23:38:00 +0200 |
commit | 3f3dda5a77fa8faf6d97aa5a0ed3b0fc6e8c0918 (patch) | |
tree | 81fcf664ab2abfda200061e57fa488ae17b03192 /tools/trimcc.nim | |
parent | 66a7e3d37c0303997a6b1a3b7ec263dfb8c07748 (diff) | |
download | Nim-3f3dda5a77fa8faf6d97aa5a0ed3b0fc6e8c0918.tar.gz |
implemented multi methods
Diffstat (limited to 'tools/trimcc.nim')
-rwxr-xr-x | tools/trimcc.nim | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/trimcc.nim b/tools/trimcc.nim index f946256c9..966f406d4 100755 --- a/tools/trimcc.nim +++ b/tools/trimcc.nim @@ -2,8 +2,9 @@ import strutils, os -proc newName(f: string): string = - return extractDir(f) / "trim_" & extractFilename(f) +proc newName(f: string): string = + var (dir, name, ext) = splitFile(f) + return dir / "trim_" & name & ext proc walker(dir: string) = for kind, path in walkDir(dir): @@ -11,7 +12,7 @@ proc walker(dir: string) = of pcFile: moveFile(newName(path), path) # test if installation still works: - if executeShellCommand(r"nimrod c --force_build tests\tlastmod") == 0: + if execShellCmd(r"nimrod c --force_build tests\tlastmod") == 0: echo "Optional: ", path removeFile(newName(path)) else: |