Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools/cmd/getgo: Various comments on shell assumptions #21274
From browsing the source it uses the expansion of $HOME, but doesn't escape the value.
It appends to .bash_profile, but bash will read .profile if .bash_profile doesn't exist, and some bash users do that so they've one file read by different shells. Actually, bash uses the first of these it finds: .bash_profile, .bash_login, .profile, so it might be .bash_login that needs modifying.
zsh reads from .zprofile, but zshConfig is .zshrc; that's for interactive shells, akin to .bashrc, and the wrong place.
Speaking of different shells, `FOO=bar; export FOO' doesn't do any harm.
I don't see why that function uppercases name each time it's used?
When presenting this, you might want to consider wrapping it to multiple physical lines so it doesn't break awkwardly, is more readable, and users paste in the break at a harmful place. No backslashes are required.
Re-running go_installer upgrades go, so I might like to keep it around? It's going to stay anyway if it fails.