Site IDs that start with a dash break `cd` command

Bug Summary

Sometimes the randomly generated site ID starts with a dash, like -QS0WNALf. That breaks a normal cd -QS0WNALf command.

Steps to reproduce

  1. Create and environment with where the ID starts with a -, like -QS0WNALf
  2. cd “~/Library/ApplicationSupport/Local/run/-QS0WNALf”. You’ll get an error:

bash: cd: -Q: invalid option
cd: usage: cd [-L|-P] [dir]

  1. Alternate versions of the command will work, like cd ./-QS0WNALf or cd -- -QS0WNALf

Environment Info

  • OS X 15.2
  • Local Version 9.2.2+6771

Thank you for bringing our attention to this @iandunn! I’m passing it along to our Local devs. We’ll share any updates here along the way.