-
Notifications
You must be signed in to change notification settings - Fork 393
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
test: smoke test with cjs/esm dual package #1644
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@llamaindex/autotool
@llamaindex/cloud
@llamaindex/community
@llamaindex/core
@llamaindex/env
@llamaindex/experimental
llamaindex
@llamaindex/node-parser
@llamaindex/readers
@llamaindex/wasm-tools
@llamaindex/workflow
@llamaindex/anthropic
@llamaindex/clip
@llamaindex/cohere
@llamaindex/deepinfra
@llamaindex/google
@llamaindex/groq
@llamaindex/huggingface
@llamaindex/mistral
@llamaindex/mixedbread
@llamaindex/ollama
@llamaindex/openai
@llamaindex/portkey-ai
@llamaindex/replicate
@llamaindex/vercel
@llamaindex/vllm
commit: |
); | ||
await writeFile(filePath, esmCode, "utf-8"); | ||
|
||
execSync(`${process.argv[0]} ${filePath}`, { |
Check warning
Code scanning / CodeQL
Shell command built from environment values Medium
absolute path
); | ||
await writeFile(filePath, esmCode, "utf-8"); | ||
|
||
execSync(`${process.argv[0]} ${filePath} -C ${condition}`, { |
Check warning
Code scanning / CodeQL
Shell command built from environment values Medium
absolute path
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 11 days ago
To fix the problem, we should avoid constructing the shell command as a single string and instead use execFileSync
to pass the command and its arguments separately. This approach ensures that the shell does not misinterpret any special characters in the arguments.
- Replace the
execSync
calls withexecFileSync
to separate the command and its arguments. - Update the imports to include
execFileSync
fromnode:child_process
.
-
Copy modified line R1 -
Copy modified line R51 -
Copy modified line R65 -
Copy modified line R81
@@ -1,2 +1,2 @@ | ||
import { execSync } from "node:child_process"; | ||
import { execFileSync } from "node:child_process"; | ||
import { mkdir, rm, writeFile } from "node:fs/promises"; | ||
@@ -50,3 +50,3 @@ | ||
|
||
execSync(`${process.argv[0]} ${filePath}`, { | ||
execFileSync(process.argv[0], [filePath], { | ||
cwd: process.cwd(), | ||
@@ -64,3 +64,3 @@ | ||
|
||
execSync(`${process.argv[0]} ${filePath}`, { | ||
execFileSync(process.argv[0], [filePath], { | ||
cwd: process.cwd(), | ||
@@ -80,3 +80,3 @@ | ||
|
||
execSync(`${process.argv[0]} ${filePath} -C ${condition}`, { | ||
execFileSync(process.argv[0], [filePath, '-C', condition], { | ||
cwd: process.cwd(), |
No description provided.