Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes #18 - Throw on complete failure instead of exiting the process

  • Loading branch information...
commit 25138020216c6850b5c7b0bde20db57b27218271 1 parent 83d9d65
@davglass davglass authored
Showing with 6 additions and 8 deletions.
  1. +6 −8 lib/complete.js
View
14 lib/complete.js
@@ -128,7 +128,7 @@ function ensure(program) {
ensure.rc = function() {
- var data = '', err;
+ var data = '', err, msg = complete.installMessage;
if (argv.install) {
process.stdout.write(source);
@@ -145,21 +145,19 @@ ensure.rc = function() {
if ((err && err.code === 'ENOENT') || !~data.indexOf('# NODE-COMPLETE')) {
data += source;
- if (!complete.installMessage) {
+ if (!msg) {
var name = getName();
- process.stdout.write([
+ msg = [
'',
'ATTENTION: Your environment doesn\'t support auto-complete.',
'To enable it, try running the following commands:',
' node ' + name + ' --install >> ' + bashrc,
' source ' + process.env['HOME'] + '/.node-completion/' + name,
''
- ].join('\r\n'));
+ ].join('\r\n');
}
- else {
- process.stdout.write(complete.installMessage);
- }
- process.exit(0);
+
+ throw msg;
}
Please sign in to comment.
Something went wrong with that request. Please try again.