Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Windows]: Error when passing templ;ate into $  #519

@budarin

Description

@budarin

Steps to Reproduce the Problem

const d = new Date();
let folderName = `${d.toLocaleString().replace(', ', '_').replaceAll('/', '-')}`;

await $`yarn npx 0x --collect-only --output-dir ./flame-graphs/${folderName} ./dist/server.js;`;

after running the script get the cmd

yarn npx 0x --collect-only --output-dir ./flame-graphs/$'29.09.2022_23:22:45__1.43.19' ./dist/server.js

instead of

yarn npx 0x --collect-only --output-dir ./flame-graphs/29.09.2022_23:22:45__1.43.19 ./dist/server.js

the same behavior is observed when passing parameters

const flags = [
  '--collect-only', 
  '--output-dir', 
  `./flame-graphs/${folderName}`, 
  '-P',
  '\'sh ./benchmark.sh\'',
  './dist/server.js'
];

await $`yarn npx 0x ${flags}`

the result is the same

yarn npx 0x --collect-only \
    --output-dir $'./flame-graphs/29.09.2022_23:33:06__1.43.19' \
    -P $'\'sh ./benchmark.sh\'' \
    ./dist/server.js

instead of

yarn npx 0x --collect-only \
    --output-dir ./flame-graphs/29.09.2022_23:33:06__1.43.19 \
    -P 'sh ./benchmark.sh' \
    ./dist/server.js

Error:

$ yarn npx 0x --collect-only --output-dir ./flame-graphs/$'30.09.2022_08:18:12__1.44.3' -P 'sh ./scripts/flame-graph/benchmark.sh' ./dist/server.js;
 
The system cannot find the path specified.
Error: The system cannot find the path specified.
    at file:///D:/Project/scripts/script.mjs:52:8
    exit code: 1
error Command failed with exit code 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions