Skip to content
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

Switch stubs throw syntax error "&" unexpected #215

Closed
ChrisChoke opened this issue Apr 8, 2024 · 1 comment · Fixed by #217
Closed

Switch stubs throw syntax error "&" unexpected #215

ChrisChoke opened this issue Apr 8, 2024 · 1 comment · Fixed by #217
Labels
bug Something isn't working

Comments

@ChrisChoke
Copy link

Please provide a clear and concise description of the bug along with logs

What are the steps to reproduce this issue?

  1. switch stubs to esp32

What happens?

syntax error

What were you expecting to happen?

Any logs, error output, etc?

(To get extension logs see Terminal > Output > Extension Host and copy output concerning pico-w-go or micropico)
(If it’s long, please paste to https://gist.github.com and insert the link here)

Any other comments?

i think the "&" sign can be removed?!

`&"${pip}" install ${port}==${version} ` + `--target "${target}" --no-user`,

Which version of MicroPico are you using?

3.7.5

Support info

Copy this from the Help -> Info/About -> Copy (Code -> About Visual Studio Code -> Copy on macOS) option in Visual Studio Code:

<paste here>
@ChrisChoke ChrisChoke added the bug Something isn't working label Apr 8, 2024
@wtakuo
Copy link
Contributor

wtakuo commented Apr 9, 2024

Hi.
I ran into the exact same problem last night (as in the screenshot below), and it occurred to me that there might be a problem with the & in that line of stubs.mts.
I am also using macOS (Sonoma 14.4.1), VScode v1.88.0 and MicroPico v3.7.5.
This is a problem that depends on the shell syntax and will probably occur in Linux as well.

I am not currently using Windows, but I think the & at the beginning of the command is probably required by PoweShell. Therefore, instead of simply removing the '&', why not do the following?

  const result = execSync(
    (process.platform === "win32" ? "&" : "") +
    `"${pip}" install ${port}==${version} ` + `--target "${target}" --no-user`,
    process.platform === "win32" ? { shell: "powershell" } : {}
  );

I would send a pull request for the fix, but for some unknown reason the extension (vsix file) built in my cloned repository doesn't work in my environment. So I'll just leave this comment here.
For the time being, I modified ~/.vscode/extensions/paulober.pico-w-go-3.7.5-darwin-arm64/dist/extension.cjs directly after installing the extension. :-)

ScreenShot 2024-04-09 10 43 05

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants