I’m writing a couple of node shell scripts for use when developing on a platform. We have both Mac and Windows developers. Is there a variable I can check for in Node to run a .sh file in one instance and .bat in another?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The variable to use would be
process.platformOn Mac the variable is set to
darwin. On Windows, it is set towin32(even on 64 bit).Current possible values are:
aixdarwinfreebsdlinuxopenbsdsunoswin32android(Experimental, according to the link)I just set this at the top of my jakeFile: