Skip to content

Commit

Permalink
fix(install): pass agent correctly to packageJson function (#1901)
Browse files Browse the repository at this point in the history
closes #1899
- at some point the syntax changed, so we need to pass the agent differently
  • Loading branch information
acburdine authored Nov 14, 2024
1 parent b07748a commit 7bf44ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/tasks/yarn-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ const getProxyAgent = require('../utils/get-proxy-agent');

const subTasks = {
async dist(ctx) {
const proxyAgent = getProxyAgent();
const {dist, engines = {}} = await packageInfo('ghost', {
version: ctx.version,
agent: getProxyAgent()
agent: proxyAgent ? {https: proxyAgent} : false
});

const skipNodeVersionCheck = (process.env.GHOST_NODE_VERSION_CHECK === 'false');
Expand Down
3 changes: 2 additions & 1 deletion lib/utils/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ const MIN_RELEASE = '>= 1.0.0';

const utils = {
async loadVersions(includePrerelease = false) {
const proxyAgent = getProxyAgent();
const result = await packageJson('ghost', {
allVersions: true,
agent: getProxyAgent()
agent: proxyAgent ? {https: proxyAgent} : null
});
const versions = Object.keys(result.versions)
.filter(v => semver.satisfies(v, MIN_RELEASE, {includePrerelease}))
Expand Down

0 comments on commit 7bf44ee

Please sign in to comment.