wildcrane-runner 0.6.107 → 0.6.109

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,9 +28,13 @@ const PROGRAM = (() => {
28
28
  if (/[\\/](_npx|dlx)[\\/]/.test(entry)) return `npx --yes ${NAME}@${VERSION}`
29
29
  const base = path.basename(entry).toLowerCase().replace(/\.(cmd|ps1|exe)$/, '')
30
30
  if (base === 'akb' || base === NAME) return 'akb'
31
- return `node ${nearPath(entry)}`
31
+ return `node ${shellWord(nearPath(entry))}`
32
32
  })()
33
33
 
34
+ function shellWord(value) {
35
+ return /^[\w./:@=-]+$/.test(value) ? value : `"${value.replace(/["`$\\]/g, '\\$&')}"`
36
+ }
37
+
34
38
  // How a path is spelled in something a person is meant to paste back.
35
39
  //
36
40
  // Relative when it is a short hop down from where the command was typed — a checkout says