-
Notifications
You must be signed in to change notification settings - Fork 889
refactor: Add install script for coder CLI #243
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #243 +/- ##
==========================================
- Coverage 67.31% 67.02% -0.30%
==========================================
Files 120 120
Lines 6484 6484
Branches 67 67
==========================================
- Hits 4365 4346 -19
- Misses 1701 1717 +16
- Partials 418 421 +3
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make this a Makefile target instead?
It could run our make build
, then even copy all binaries in ./bin
to $(go env GOPATH)/bin
.
I'm concerned about users thinking install.sh
would install all of Coder, not just the CLI.
install.sh
Outdated
|
||
go install cmd/coder/main.go | ||
echo "Coder CLI now installed at:" | ||
echo "$(which coder)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can make this more accurate with:
echo "$(go env GOPATH)/bin/coder"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could even do both, install to that location, check if they are different, and if so, emit a warning indicating that something else in PATH is shadowing the one we just installed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, unsure whether it matters for this particular script, but if you run it on Windows, then it might not work correctly due to the .exe extension
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I switched to use make install
here: 0b16731 - and made the extension matching in 4415638
Our current strategy (having ./develop.sh
and a Makefile
) is assuming we have some sort of POSIX toolchain in the Windows environment - like Mingw/cygwin. Might be something we have to think about fixing up later.
Sure! I think the canonical way for Still kind of sounds like it would install everything - but since we're copying all the binaries ( |
I think that'd be good! I'm just used to |
This adds an
install.sh
script at the root which runsgo install cmd/coder/main.go
- makingcoder
available by default in our workspaces (where thego
bin folder is already in thePATH
).I thought this might be helpful for developer who aren't familiar with
go
or the directory structure, in runningcoder
CLI locally. Open to other ideas though!