Last active
December 14, 2015 16:36
-
-
Save nilz3ro/38ac76ad2cb88e0a3cd3 to your computer and use it in GitHub Desktop.
npm-scripts compatible way to exit if you are not using the supported node version for your project.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var message = ''; | |
var exitCode = 0; | |
var supportedNodeVersion = 'v0.10.36'; | |
if(process.version === supportedNodeVersion) { | |
message = 'You are using the supported node version for this project, Continuing.'; | |
} | |
else { | |
message = 'You must use node v0.10.36 while developing this project. Exiting.'; | |
exitCode = 1; | |
} | |
console.log(message); | |
process.exit(exitCode); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment