diff options
author | isaacs <i@izs.me> | 2010-05-10 12:58:40 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2010-05-10 12:58:54 +0400 |
commit | 40122bcd00d2d1e0255a809796c264e72f6b4869 (patch) | |
tree | 901feff55f549aa9e8a148f4cac39f6a9ef3724f /lib | |
parent | 4644fb1d355b1abc10003f9f5478270d53f3d5b6 (diff) |
Fix some folder/path bugs that were throwing off tar.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cache.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/cache.js b/lib/cache.js index b661c2797..690d1fde2 100644 --- a/lib/cache.js +++ b/lib/cache.js @@ -212,7 +212,10 @@ function unpackTar (tarball, unpackTarget, cb) { } function packTar (targetTarball, folder, cb) { log(folder+" "+targetTarball, "packTar") - var parent = path.dirname(folder) + if (folder.charAt(0) !== "/") folder = path.join(process.cwd(), folder) + if (folder.slice(-1) === "/") folder = folder.slice(0, -1) + var cwd = process.cwd() + , parent = path.dirname(folder) , addFolder = path.basename(folder) mkdir(path.dirname(targetTarball), function (er) { if (er) return log.er(cb, "Could not create "+targetTarball)(er) @@ -225,5 +228,6 @@ function packTar (targetTarball, folder, cb) { ] , cb ) + process.chdir(cwd) }) } |