Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mustard-mh committed Nov 7, 2023
1 parent eaeac93 commit f2fb018
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ tasks:
gp env -u GCP_ADC_FILE
fi
exit 0
- name: Install `gitpod` CLI
command: |
leeway run components/local-app:install-cli
leeway run components/local-app:cli-completion
exit 0
# This task takes care of configuring your workspace so it can manage and interact
# with preview environments.
- name: Preview environment configuration
Expand Down
8 changes: 5 additions & 3 deletions components/local-app/BUILD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ packages:

scripts:
- name: install-cli
description: "Install gitpod-cli as gitpod command and add auto-completion. Usage: '. $(leeway run components/local-app:install-cli)'"
description: "Install gitpod-cli as `gitpod` command and add auto-completion. Usage: '. $(leeway run components/local-app:install-cli)'"
script: |
go build -o gitpod ./main/gitpod-cli
sudo mv gitpod /usr/bin/gitpod
sudo chmod +x /usr/bin/gitpod
# pipe completion
sudo /usr/bin/gitpod completion bash | sudo tee /usr/share/bash-completion/completions/gitpod
- name: cli-completion
description: "Add completion of gitpod-cli to bash-completion. Usage: '. $(leeway run components/local-app:cli-completion)'"
script: |
sudo /usr/bin/gitpod completion bash | sudo tee /usr/share/bash-completion/completions/gitpod > /dev/null
16 changes: 15 additions & 1 deletion components/local-app/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# local-app
# local-app

## gitpod-cli

Expand Down Expand Up @@ -27,6 +27,20 @@ Start by logging in with `gitpod login`, which will also create a default contex

To develop the CLI with Gitpod, you can run it just like locally, but in Gitpod workspaces, a browser and a keyring are not available. To log in despite these limitations, provide a PAT via the `GITPOD_TOKEN` environment variable, or use the `--token` flag with the login command.

#### in Gitpod workspace

[![Open in Gitpod](https://www.gitpod.io/svg/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/gitpod-io/gitpod)

You will have gitpod-cli ready as `gitpod` in your CDE (Cloud Development Environments) workspace, will commands below you can install again easily.

```
# Install as `gitpod` again
leeway run components/local-app:install-cli
# Add completion again
leeway run components/local-app:cli-completion
```

## local-app

**Beware**: this is very much work in progress and will likely break things.
Expand Down

0 comments on commit f2fb018

Please sign in to comment.