Comparing version 1.0.3 to 1.0.4
@@ -21,3 +21,3 @@ 'use strict'; | ||
utils.handleError(err); | ||
if (err) return false; | ||
@@ -40,3 +40,8 @@ switch (cmd) { | ||
break; | ||
case 'rm': | ||
dots.rm(args[1]); | ||
break; | ||
} | ||
}); |
@@ -37,2 +37,3 @@ 'use strict'; | ||
if (err) return utils.handleError('No such file!'); | ||
if (!err && stats.isFile()) { | ||
@@ -55,3 +56,4 @@ | ||
utils.handleError(err); | ||
if (err) return utils.handleError('No such bundle!'); | ||
if (!dots.length) return console.log('\x1b[31m%s\x1b[0m', 'You don\'t have any bundles yet!'); | ||
console.log('\x1b[32m%s\x1b[0m', dots.reduce(function (agg, dot) { | ||
@@ -64,2 +66,11 @@ | ||
function removeDots (dir) { | ||
fs.remove(homeDot(dir), function (err) { | ||
if (err) return utils.handleError('No such bundle!'); | ||
console.log('\x1b[32m%s\x1b[0m', dir + ' bundle has been removed!'); | ||
}); | ||
} | ||
module.exports = { | ||
@@ -72,7 +83,8 @@ | ||
utils.handleError(err); | ||
if (err) return utils.handleError('No such bundle!'); | ||
handleDots(true, dir, dots); | ||
}); | ||
}, | ||
list: listDots | ||
list: listDots, | ||
rm: removeDots | ||
}; |
@@ -8,8 +8,5 @@ 'use strict'; | ||
handleError: function (err) { | ||
handleError: function (msg) { | ||
if (err) { | ||
throw new Error(err); | ||
} | ||
return console.log('\x1b[31m%s\x1b[0m', msg); | ||
}, | ||
@@ -16,0 +13,0 @@ dotsHome: path.join(home(), '.dots'), |
{ | ||
"name": "gimme-dots", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Gimme my dotfiles! Store your common dotfiles and request them into your new project.", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -29,2 +29,7 @@ # Gimme my dotfiles! | ||
Remove bundle: | ||
``` | ||
dots rm name | ||
``` | ||
List all bundles: | ||
@@ -37,3 +42,3 @@ ``` | ||
``` | ||
dost list name | ||
dots list name | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57810
101
43