Skip to content

Commit ce6c989

Browse files
committed
Remove soljson.js if download is interrupted
1 parent 13f31dd commit ce6c989

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

downloadCurrentVersion.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ function downloadBinary (outputName, version, expectedHash) {
3333
fs.unlinkSync(outputName);
3434
}
3535

36+
process.on('SIGINT', function () {
37+
console.log('Interrupted, removing file.');
38+
fs.unlinkSync(outputName);
39+
process.exit(1);
40+
});
41+
3642
var file = fs.createWriteStream(outputName, { encoding: 'binary' });
3743
https.get('https://ethereum.github.io/solc-bin/bin/' + version, function (response) {
3844
if (response.statusCode !== 200) {

0 commit comments

Comments
 (0)