Skip to content

Commit d5497be

Browse files
eavilesrochdev
authored andcommitted
Adds an option to skip downloading binaries (#590)
* Add an option to skip downloads * Make the skip download env var less generic
1 parent 8240ddb commit d5497be

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

scripts/post_install.js

+10-6
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ const pkg = require('../package.json')
1313
const name = `${os.platform()}-${os.arch()}`
1414

1515
if (process.env.DD_NATIVE_METRICS !== 'false') {
16-
download(`v${pkg.version}`)
17-
.catch(() => getLatestTag().then(download))
18-
.then(persist)
19-
.then(extract)
20-
.then(cleanup)
21-
.catch(rebuild)
16+
if (process.env.DD_SKIP_PREBUILT_DOWNLOAD !== 'true') {
17+
download(`v${pkg.version}`)
18+
.catch(() => getLatestTag().then(download))
19+
.then(persist)
20+
.then(extract)
21+
.then(cleanup)
22+
.catch(rebuild)
23+
} else {
24+
rebuild()
25+
}
2226
}
2327

2428
function rebuild () {

0 commit comments

Comments
 (0)