-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add preinstall script #4
Conversation
@gabru-md Could you test this. |
preinstall.js ? is it missing ? |
I've added the file. See 6ff481b. I don't know how it never got commited. I usually run |
preinstall.js
Outdated
var spawn = require('child_process').spawn; | ||
var readline = require('readline'); | ||
var terminal = require('terminal-utilities') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chalk is missing from the modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. See c74eae2
preinstall.js
Outdated
}); | ||
|
||
exec('which wget', function(err,stdout,stderr){ | ||
if(err){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a problem with the use of if/else here all throughout the code.
if an error is encountered it means that wget
is not present, and hence must be installed. But the code seems to do something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. See 6edb0c1
preinstall.js
Outdated
if(stdout){ | ||
console.log('wget is required to install this module'); | ||
exec('which apt-get', function(err,stdout,stderr){ | ||
if(stdout){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same goes for here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. See 6edb0c1
preinstall.js
Outdated
terminal.write(data); | ||
}); | ||
installation.on('close', function(code){ | ||
console.log('wget installed successfully'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
process.exit(0) is missing.
the process stops thereafter and has to be manually terminated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. See 6e6447b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do the following changes before merge can be done!
preinstall.js
Outdated
} | ||
}); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some brackets are missing. fix them as well.
:D
@gabru-md I've made the changes that you have requested. |
there were still some issues to be resolved. due to asynchronous nature of Node.JS, the Thanks for the contribution though. |
@gabru-md The reason I set it to be |
I haven't tested this because uninstalling wget uninstalls google-chrome for some reason.