-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
agracio
committed
Jun 6, 2024
1 parent
fb9f30c
commit 3b7c19f
Showing
3 changed files
with
32 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
var {http} = require('follow-redirects'); | ||
|
||
|
||
console.log('Trying download from', process.argv[2]); | ||
http.get(process.argv[2], function (res) { | ||
console.log('HTTP', res.statusCode); | ||
if (res.statusCode !== 200) { | ||
throw new Error(`Unable to download ${process.argv[2]}`); | ||
} | ||
|
||
var stream = require('fs').createWriteStream(process.argv[3]); | ||
res.pipe(stream); | ||
}); | ||
console.log('Trying download from', process.argv[2]); | ||
http.get(process.argv[2], function (res) { | ||
console.log('HTTP', res.statusCode); | ||
if (res.statusCode !== 200) { | ||
throw new Error(`Unable to download ${process.argv[2]}`); | ||
} | ||
|
||
var stream = require('fs').createWriteStream(process.argv[3]); | ||
res.pipe(stream); | ||
}); | ||
|
This file contains 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 characters