Permalink
Browse files

updated bash-completion installer to not attempt install if the file …

…already exists
  • Loading branch information...
1 parent bb7cc91 commit d64cceb798069d4835434ffdd6f1c8673fdce8a4 @kbjr committed Mar 27, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 scripts/bash-completion.js
View
@@ -17,8 +17,14 @@ path.exists(BASH_COMPLETION, function(exists) {
if (err) {fail();}
if (stats.isDirectory()) {
- fs.symlink(COMPLETION, path.join(BASH_COMPLETION, 'crux'), function(err) {
- if (err) {fail();}
+ var cruxCompletion = path.join(BASH_COMPLETION, 'crux');
+
+ path.exists(cruxCompletion, function(exists) {
+ if (! exists) {
+ fs.symlink(COMPLETION, cruxCompletion, function(err) {
+ if (err) {fail();}
+ });
+ }
});
}

0 comments on commit d64cceb

Please sign in to comment.