Last active
April 28, 2019 10:50
-
-
Save jsynowiec/b67221be8f34ac531f17c69fdaf1efbe to your computer and use it in GitHub Desktop.
Revisions
-
jsynowiec revised this gist
Apr 28, 2019 . No changes.There are no files selected for viewing
-
Jakub Synowiec created this gist
Oct 20, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ const os = require('os'); const exec = require('child_process').exec; switch (os.platform()) { case 'win32': exec('yarn --version', (err, stdout, stderr) => { if (err) { exec('npm install'); return; } else { exec('yarn'); } }); break; case 'darwin': case 'linux': exec('if [ -z `which yarn`]; then npm install; else yarn; fi;'); break; default: throw new Error('Unsupported platform.'); }