@@ -17,12 +17,13 @@ module.exports = function(destinationPath, callback)
1717 var version = package.version.replace(/^(\d+\.\d+\.\d+).*$/, '$1'); // turn '1.2.3-alpha' into '1.2.3'
1818 var os = { 'darwin': 'mac', 'win32': 'windows', 'linux': 'linux' }[process.platform];
1919 var arch = { 'x64': '64-bit', 'ia32': '32-bit' }[process.arch];
20+ var path = process.platform === 'win32' ? destinationPath + '.exe' : destinationPath;
21+ var url = 'https://github.com/elm/compiler/releases/download/' + version + '/binary-for-' + os + '-' + arch + '.gz';
2022
21− download(
22− process.platform === 'win32' ? destinationPath + '.exe' : destinationPath,
23− 'https://github.com/elm/compiler/releases/download/' + version + '/binary-for-' + os + '-' + arch + '.gz',
24− callback
25− );
23+ // check if exists for bin/elm running for the Nth time on Windows
24+ fs.existsSync(path)
25+ ? callback()
26+ : download(path, url, callback);
2627};
2728
2829