Permalink
Browse files

fix home path on windows

  • Loading branch information...
1 parent 27d72a7 commit 0bc27ed4f768c0a7ec77c383b4382af2c8d117f1 Hsiaoming Yang committed Mar 26, 2013
Showing with 6 additions and 3 deletions.
  1. +4 −2 lib/install.js
  2. +2 −1 lib/plugin.js
View
6 lib/install.js
@@ -21,10 +21,12 @@ var mo = require('./sdk/module');
var git = require('./sdk/git');
var _cache = {};
+
+var homedir = process.env.HOME || process.env.HOMEPATH;
var store = {
dest: spmrc.get('install.path'),
- cache: path.join(process.env.HOME, '.spm', 'cache'),
- srcCache: path.join(process.env.HOME, '.spm', 'src'),
+ cache: path.join(homedir, '.spm', 'cache'),
+ srcCache: path.join(homedir, '.spm', 'src'),
parallel: 1
};
View
3 lib/plugin.js
@@ -9,7 +9,8 @@ var path = require('path');
var color = require('colorful');
var grunt = require('./sdk/grunt');
-var pluginsPath = path.join(process.env.HOME, '.spm', 'plugins.json');
+var homedir = process.env.HOME || process.env.HOMEPATH;
+var pluginsPath = path.join(homedir, '.spm', 'plugins.json');
exports.install = function(options) {

0 comments on commit 0bc27ed

Please sign in to comment.