Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 5 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ This repository contains source code for Coder V2. Additional documentation:

The `develop.sh` script runs the server locally on port `3000`, and runs a hot-reload server for front-end code on `8080`.

### CLI

- `./install.sh` will `go install` the `coder` CLI
- `coder --help`

## Front-End Plan

For the front-end team, we're planning on 2 phases to the 'v2' work:
Expand Down
7 changes: 7 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -euo pipefail

go install cmd/coder/main.go
echo "Coder CLI now installed at:"
echo "$(which coder)"
Copy link
Member

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"

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor Author

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.