Skip to content

Commit 1fbfd31

Browse files
authored
Merge pull request #156 from ethereum/download-cleanup
Some cleanups in the download scripts
2 parents 9e9562a + ce6c989 commit 1fbfd31

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

downloadCurrentVersion.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ function getVersionList (cb) {
2828
function downloadBinary (outputName, version, expectedHash) {
2929
console.log('Downloading version', version);
3030

31+
// Remove if existing
32+
if (fs.existsSync(outputName)) {
33+
fs.unlinkSync(outputName);
34+
}
35+
36+
process.on('SIGINT', function () {
37+
console.log('Interrupted, removing file.');
38+
fs.unlinkSync(outputName);
39+
process.exit(1);
40+
});
41+
3142
var file = fs.createWriteStream(outputName, { encoding: 'binary' });
3243
https.get('https://ethereum.github.io/solc-bin/bin/' + version, function (response) {
3344
if (response.statusCode !== 200) {

0 commit comments

Comments
 (0)