Permalink
Browse files

Fixed some resolves in cache.

  • Loading branch information...
1 parent e316a74 commit 3e505d64c2d14414d3ccf9f857e9c556e50d47fb @petebacondarwin committed May 18, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/cache.js
View
@@ -5,7 +5,7 @@ var tar = require('./tar'),
env = require('./env');
-exports.CACHE_DIR = env.home + '/.kanso/cache';
+exports.CACHE_DIR = path.resolve(env.home,'.kanso/cache');
exports.add = function (name, version, filepath, callback) {
@@ -69,7 +69,7 @@ exports.moveTar = function (name, version, filepath, callback) {
};
exports.dir = function (name, version) {
- return exports.CACHE_DIR + '/' + name + '/' + version;
+ return path.resolve(exports.CACHE_DIR,name,version);
};
exports.clear = function (name, version, callback) {
@@ -86,10 +86,10 @@ exports.clear = function (name, version, callback) {
dir = exports.CACHE_DIR;
}
else if (!version) {
- dir = exports.CACHE_DIR + '/' + name;
+ dir = path.resolve(exports.CACHE_DIR,name);
}
else {
- dir = exports.CACHE_DIR + '/' + name + '/' + version;
+ dir = path.resolve(exports.CACHE_DIR,name,version);
}
utils.rm(dir, callback);
};

0 comments on commit 3e505d6

Please sign in to comment.