Skip to content

Build and watch script - #15

Closed
probablycorey wants to merge 1 commit into
masterfrom
build-and-watch
Closed

probablycorey wants to merge 1 commit into
masterfrom
build-and-watch

Conversation

@probablycorey

@probablycorey probablycorey commented Oct 13, 2019 •

Copy link
Copy Markdown
Contributor

I've been annoyed with how tedious it is to build and test this app against real repos.

Option 1: One solution is to add a -C command that will run the commands against a specific directory. Then you can run go run . -C some-dir to test the app.

Option 2: My other idea was to have a build-and-watch script that would watch for changes and then build the app. Then I symlinked the binary to ~/bin/ and then I could run gh wherever I wanted.

This PR builds option 2.
Now run script/build-and-watch Every time you change your code it will recompile.

  • As it is building there is a status indicator in the terminal’s title. 🚧 for building, ✳️ for success, and 🛑 for error.
  • If there is an error it will replace gh with a command that says there was a build failure.
  • If there is a success you’ll have a new build of gh ready to use!

But as I am writing this up I think option 2 might be a better idea. I'm still opening a draft PR so we have something to talk about.

@probablycorey probablycorey mentioned this pull request Oct 13, 2019
7 of 9 tasks
@mislav

mislav commented Oct 14, 2019

Copy link
Copy Markdown
Contributor

One solution is to add a -C command that will run the commands against a specific directory.

This is not a bad idea. Git supports this.

Have you tried GH_REPO? https://github.com/github/gh-cli/blob/3a80cd10214700ced12ba8c8ac67868303f1b7aa/command/pr.go#L632-L642

It allows you to run gh commands against an arbitrary repository. It doesn't even have to be cloned. The problem is that the active branch (used by some commands) will still be taken from the current repository.

@probablycorey

Copy link
Copy Markdown
Contributor Author

Have you tried GH_REPO?

Oh neat! That might good enough for now. I'm going to close this out.

@mislav
mislav deleted the build-and-watch branch October 15, 2019 14:10
vilmibm pushed a commit that referenced this pull request Jun 29, 2021
made branch and line flags, fixed path
mislav pushed a commit that referenced this pull request Sep 28, 2021
Add OpenTelemetry instrumentation
Stonre pushed a commit to Stonre/strands-fork that referenced this pull request Jul 21, 2025
To match the GitHub repository title
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants