Skip to content

Commit

Permalink
fix: explicitly ask for latest from npm (#1107)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Feb 15, 2023
1 parent 805aa66 commit 7991005
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/commands/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ export default class Manifest extends Command {
const tmpDir = os.tmpdir()
const promises = Object.entries(packageJson.oclif.jitPlugins).map(async ([jitPlugin, version]) => {
const pluginDir = jitPlugin.replace('/', '-').replace('@', '')
const repo = this.executeCommand(`npm view ${jitPlugin} repository --json`)
const repo = this.executeCommand(`npm view ${jitPlugin}@latest repository --json`)
const stdout = JSON.parse(repo.stdout)

const repoUrl = stdout.url.replace(`${stdout.type}+`, '')

const fullPath = path.join(tmpDir, pluginDir)
if (await fileExists(fullPath)) await fs.remove(fullPath)

const versions = JSON.parse(this.executeCommand(`npm view ${jitPlugin} versions --json`).stdout)
const versions = JSON.parse(this.executeCommand(`npm view ${jitPlugin}@latest versions --json`).stdout)
const maxSatisfying = semver.maxSatisfying(versions, version)

this.cloneRepo(repoUrl, fullPath, maxSatisfying)
Expand Down

0 comments on commit 7991005

Please sign in to comment.