craftcms / nitro

Speedy local dev environment for @craftcms.
https://getnitro.sh
MIT License
178 stars 24 forks source link

Nitro Share does not support ngrok v3 #466

Closed J-Protz closed 2 years ago

J-Protz commented 2 years ago

Description

A coworker attempted to nitro share, but had yet to install ngrok. He installed it via homebrew, which automatically gave him 3.x, and when he tried to share it would give this error:

unknown shorthand flag: 'o' in -ost-header=<site-name>

When looking in to this, I noted my ngrok version was 2.3.x and works flawlessly, so I dug in to the upgrade changes seen here: https://ngrok.com/docs/guides/upgrade-v2-v3 and noted:

"The ngrok agent only accepts long name flags prefixed with -- and will error if a single hyphen is used. When updating your scripts, ensure things like --hostname and --host-header are using double hyphens."

I found the script in the repo /command/share/share.go line 170 uses the single hyphen.

Tested on my local with two hyphens, the command still works in ngrok v2, so I would recommend simply switching it out for 2 hyphens to be compatible with v2+v3

Steps to reproduce

  1. Download Ngrok v3 via homebrew
  2. Nitro Share

Additional info

jasonmccallister commented 2 years ago

Thank you for looking into this! Just pushed 349936e30e84f2d166a88bbb95e91d5d963fcf13 with this change.

jasonmccallister commented 2 years ago

Just tagged 2.0.10 with this change!

J-Protz commented 2 years ago

Thank you!