code-connect icon indicating copy to clipboard operation
code-connect copied to clipboard

Copied links need to be in quotes in the CLI

Open sekeidesign opened this issue 1 year ago • 7 comments

I had originally started writing this issue because I kept getting errors when trying to scaffold a new component. Although this is a minor issue, I can see some people getting hung up on it. The solution is simply to wrap the copied link in quotes to make sure the command doesn't break.

I think the instructions should reflect this, saying something like

npx figma connect create "https://..." --token <auth token>

CleanShot 2024-04-16 at 16 19 42@2x

sekeidesign avatar Apr 16 '24 20:04 sekeidesign

Hey @sekeidesign, interesting that you have this issue! On my Mac, in both iTerm 2 and Apple Terminal, pasting a URL with ? or = characters automatically escapes it, see this video:

https://github.com/figma/code-connect/assets/117714347/bbb4642f-66b0-4743-92ed-8f5466be91ca

What terminal software are you using?

We'll look to add a note about this in any case!

tomduncalf-figma avatar Apr 17 '24 10:04 tomduncalf-figma

I too also encountered the put the Copy Link to Selection URL of the component set into "" issue. I am using VS Code's built-in terminal

There seems to be a fxn on line 41 in helpers.js that validates if the URL is a string that is showing this error

Screenshot 2024-04-17 at 10 26 09 AM

devindoming0 avatar Apr 17 '24 14:04 devindoming0

Interesting, it seems that some terminals must not escape special characters when you paste. It's strange because when I try the same on the VS Code terminal, it correctly changes ? to \? and = to \=. Maybe there is some configuration settings which controls this.

In any case, the solution @devindoming0 is to wrap the URL in quotes if your terminal doesn't escape it. We'll update the README to reflect this.

Thanks for the report!

tomduncalf-figma avatar Apr 17 '24 14:04 tomduncalf-figma

Same issue her with Windows PowerShell in VS-Code:

PowerShell: image

WSL: image

Julian-B90 avatar Apr 17 '24 18:04 Julian-B90

Hey @sekeidesign, interesting that you have this issue! On my Mac, in both iTerm 2 and Apple Terminal, pasting a URL with ? or = characters automatically escapes it, see this video:

Untitled.mov What terminal software are you using?

We'll look to add a note about this in any case!

I use Warp as my terminal!

sekeidesign avatar Apr 17 '24 22:04 sekeidesign

Hey everyone In my case (Windows VSCode - default terminal / powershell) passing url in "" doesn't helped. I was getting:

'node-id' is not recognized as an internal or external command, operable program or batch file. Invalid parameter - =dev

In my case the "Git Bash" terminal was the one that worked!

@michal-szymczak-ui-developer could you share the command that failed in Windows VS Code?

ptomas-figma avatar Apr 22 '24 09:04 ptomas-figma