-
Notifications
You must be signed in to change notification settings - Fork 7
fix invocation of npm and npx #101
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,5 +1,5 @@ | ||||||
module PageFind | ||||||
using NodeJS_22_jll: npx, npm | ||||||
using NodeJS_22_jll: npx, npm, node | ||||||
using HypertextLiteral: @htl | ||||||
|
||||||
function inject_script!(custom_scripts, rootpath) | ||||||
|
@@ -29,16 +29,22 @@ function render() | |||||
end | ||||||
|
||||||
function build_search_index(root, docs, config, rootpath) | ||||||
if !success(Cmd(`$(npx) pagefind -V`; dir = root)) | ||||||
@info "Installing pagefind into $root." | ||||||
if !success(Cmd(`$(npm) install pagefind`; dir = root)) | ||||||
error("Could not install pagefind.") | ||||||
# npx and npm are distributed as FileProducts, | ||||||
# so the JLL does not bundle environment information into them. | ||||||
# To fix this, we wrap all uses of npx and npm inside `node() do ...` | ||||||
# which will automatically adjust the necessary environment variables. | ||||||
node() do | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Semgrep identified an issue in your code: To resolve this comment: 💡 Follow autofix suggestion
Suggested change
View step-by-step instructions
💬 Ignore this findingReply with Semgrep commands to ignore this finding.
Alternatively, triage in [Semgrep AppSec Platform](https://semgrep.dev/orgs/JuliaHub, Inc/findings/186542205) to ignore the finding created by no-whitespace-trailing. You can view more details about [this finding](https://semgrep.dev/orgs/JuliaHub, Inc/findings/186542205) in the Semgrep AppSec Platform. |
||||||
if !success(Cmd(`$(npx) pagefind -V`; dir = root)) | ||||||
@info "Installing pagefind into $root." | ||||||
if !success(Cmd(`$(npm) install pagefind`; dir = root)) | ||||||
error("Could not install pagefind.") | ||||||
end | ||||||
end | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Semgrep identified an issue in your code: To resolve this comment: ✨ Commit Assistant Fix Suggestion
Trailing whitespace can cause unnecessary diffs and may lead to problems with tools that are sensitive to whitespace. 💬 Ignore this findingReply with Semgrep commands to ignore this finding.
Alternatively, triage in [Semgrep AppSec Platform](https://semgrep.dev/orgs/JuliaHub, Inc/findings/186542204) to ignore the finding created by no-whitespace-trailing. You can view more details about [this finding](https://semgrep.dev/orgs/JuliaHub, Inc/findings/186542204) in the Semgrep AppSec Platform. |
||||||
pattern = "*/{$(join(config.index_versions, ","))}/**/*.{html}" | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Semgrep identified an issue in your code: To resolve this comment: ✨ Commit Assistant Fix Suggestion
Many editors support automatic removal of trailing whitespace (for example, in VSCode, you can enable "Trim Trailing Whitespace" in settings). Removing trailing whitespace helps prevent unnecessary diffs and keeps code clean. 💬 Ignore this findingReply with Semgrep commands to ignore this finding.
Alternatively, triage in [Semgrep AppSec Platform](https://semgrep.dev/orgs/JuliaHub, Inc/findings/186542203) to ignore the finding created by no-whitespace-trailing. You can view more details about [this finding](https://semgrep.dev/orgs/JuliaHub, Inc/findings/186542203) in the Semgrep AppSec Platform. |
||||||
run(`$(npx) pagefind --site $(root) --glob $(pattern) --root-selector article`) | ||||||
end | ||||||
|
||||||
pattern = "*/{$(join(config.index_versions, ","))}/**/*.{html}" | ||||||
|
||||||
run(`$(npx) pagefind --site $(root) --glob $(pattern) --root-selector article`) | ||||||
return nothing | ||||||
end | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Semgrep identified an issue in your code:
Avoid writing lines with trailing whitespace.
To resolve this comment:
💡 Follow autofix suggestion
View step-by-step instructions
# npx and npm are distributed as FileProducts,
.Trailing whitespace can cause unnecessary diffs and may lead to style enforcement errors in the future.
💬 Ignore this finding
Reply with Semgrep commands to ignore this finding.
/fp <comment>
for false positive/ar <comment>
for acceptable risk/other <comment>
for all other reasonsAlternatively, triage in [Semgrep AppSec Platform](https://semgrep.dev/orgs/JuliaHub, Inc/findings/186542206) to ignore the finding created by no-whitespace-trailing.
You can view more details about [this finding](https://semgrep.dev/orgs/JuliaHub, Inc/findings/186542206) in the Semgrep AppSec Platform.