Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: always re-create package-lock.json #43

Merged
merged 1 commit into from
Sep 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/providers/javascript_npm.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { execSync } from "node:child_process"
import fs from 'node:fs'
import os from "node:os";
import { getCustomPath } from "../tools.js";

Check warning on line 4 in src/providers/javascript_npm.js

View workflow job for this annotation

GitHub Actions / Lint and test project (18)

Imports should be sorted alphabetically

Check warning on line 4 in src/providers/javascript_npm.js

View workflow job for this annotation

GitHub Actions / Lint and test project (latest)

Imports should be sorted alphabetically
import path from 'node:path'
import Sbom from '../sbom.js'

Check warning on line 6 in src/providers/javascript_npm.js

View workflow job for this annotation

GitHub Actions / Lint and test project (18)

Imports should be sorted alphabetically

Check warning on line 6 in src/providers/javascript_npm.js

View workflow job for this annotation

GitHub Actions / Lint and test project (latest)

Imports should be sorted alphabetically
import {PackageURL} from 'packageurl-js'

Check warning on line 7 in src/providers/javascript_npm.js

View workflow job for this annotation

GitHub Actions / Lint and test project (18)

Imports should be sorted alphabetically

Check warning on line 7 in src/providers/javascript_npm.js

View workflow job for this annotation

GitHub Actions / Lint and test project (latest)

Imports should be sorted alphabetically

export default { isSupported, provideComponent, provideStack }

Expand Down Expand Up @@ -90,14 +90,11 @@
}
})
let manifestDir = path.dirname(manifest)
if(!fs.existsSync(path.join(manifestDir,"package-lock.json"))) {

execSync(`${npm} i --package-lock-only --prefix ${manifestDir}`, err => {
if (err) {
throw new Error('failed to create npmOutput list')
}
})
}
execSync(`${npm} i --package-lock-only --prefix ${manifestDir}`, err => {
if (err) {
throw new Error('failed to create npmOutput list')
}
})
let allFilter = includeTransitive? " --all" : ""
let npmListing = getNpmListing(npm, allFilter, manifestDir)
let npmOutput = execSync(npmListing, err => {
Expand Down
Loading