Skip to content

Commit 7bf44ee

Browse files
authored
fix(install): pass agent correctly to packageJson function (#1901)
closes #1899 - at some point the syntax changed, so we need to pass the agent differently
1 parent b07748a commit 7bf44ee

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/tasks/yarn-install.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ const getProxyAgent = require('../utils/get-proxy-agent');
1515

1616
const subTasks = {
1717
async dist(ctx) {
18+
const proxyAgent = getProxyAgent();
1819
const {dist, engines = {}} = await packageInfo('ghost', {
1920
version: ctx.version,
20-
agent: getProxyAgent()
21+
agent: proxyAgent ? {https: proxyAgent} : false
2122
});
2223

2324
const skipNodeVersionCheck = (process.env.GHOST_NODE_VERSION_CHECK === 'false');

lib/utils/version.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ const MIN_RELEASE = '>= 1.0.0';
1212

1313
const utils = {
1414
async loadVersions(includePrerelease = false) {
15+
const proxyAgent = getProxyAgent();
1516
const result = await packageJson('ghost', {
1617
allVersions: true,
17-
agent: getProxyAgent()
18+
agent: proxyAgent ? {https: proxyAgent} : null
1819
});
1920
const versions = Object.keys(result.versions)
2021
.filter(v => semver.satisfies(v, MIN_RELEASE, {includePrerelease}))

0 commit comments

Comments
 (0)