fix(apply): use a better option for getting the user's home dir

This commit is contained in:
Jason Dreyzehner 2016-10-21 12:44:26 -04:00
commit da48c12ea9

View file

@ -86,7 +86,7 @@ try {
if(typeof process.env.COPAY_EXTERNAL_SERVICES_CONFIG_LOCATION !== 'undefined') { if(typeof process.env.COPAY_EXTERNAL_SERVICES_CONFIG_LOCATION !== 'undefined') {
var location = process.env.COPAY_EXTERNAL_SERVICES_CONFIG_LOCATION; var location = process.env.COPAY_EXTERNAL_SERVICES_CONFIG_LOCATION;
if(location.charAt(0) === '~') { if(location.charAt(0) === '~') {
location = location.replace(/^\~/, os.homedir()); location = location.replace(/^\~/, process.env.HOME || process.env.USERPROFILE);
} }
console.log('Found at: ' + location); console.log('Found at: ' + location);
console.log('Copying ' + location + ' to root'); console.log('Copying ' + location + ' to root');