We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71064e6 commit d40562dCopy full SHA for d40562d
src/utils/scripts/discovery.ts
@@ -99,9 +99,11 @@ async function discoverScriptsInternal(
99
// 3. Print separator + filename
100
// 4. Print executable status
101
// 5. Print first 20 lines (for description extraction)
102
+ // Note: We quote paths to prevent shell injection
103
+ const safeScriptsDir = scriptsDir.replace(/'/g, "'\\''");
104
const command = `
- if [ -d "${scriptsDir}" ]; then
- for f in "${scriptsDir}"/*; do
105
+ if [ -d '${safeScriptsDir}' ]; then
106
+ for f in '${safeScriptsDir}'/*; do
107
[ -f "$f" ] || continue
108
echo "${separator}$(basename "$f")"
109
if [ -x "$f" ]; then echo "IS_EXECUTABLE:1"; else echo "IS_EXECUTABLE:0"; fi
0 commit comments