Skip to content
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

Change default build command path to ~/.hhfab #114

Closed

Conversation

botchagalupeai
Copy link

@botchagalupeai botchagalupeai commented Jul 18, 2024

Related to #113

Change the default build command path to ~/.hhfab.

  • cmd/hhfab/main.go:

    • Change the default value of basedirFlag from .hhfab to ~/.hhfab.
  • Makefile:

    • Update all references of .hhfab to ~/.hhfab.

Note: This pull request was created by Github's CoPilot Workspace. It seems like a simple change and I did a basic check for correctness. However, please review and feel free to reject.

For more details, open the Copilot Workspace session.

@@ -206,8 +205,8 @@ hhfab-all: fmt build-embed-cnc-bin ## Build hhfab CLI for all OS/ARCH

.PHONY: build-embed-cnc-bin
build-embed-cnc-bin: ## Build CNC binaries to embed into hhfab
touch pkg/fab/cnc/bin/hhfab-recipe
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o pkg/fab/cnc/bin/hhfab-recipe -ldflags="-w -s -X main.version=$(VERSION)" $(GOFLAGS) ./cmd/hhfab-recipe
touch ~/.hhfab/cnc/bin/hhfab-recipe
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a part of the build process for the hhfab binary itself. It shouldn't be using an absolute path, and it's not related to the hhfab workdir (.hhfab)

@@ -1,17 +1,3 @@
// Copyright 2023 Hedgehog
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks kinda strange that the copyright was removed...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that. I think copliot workspace is still in preview mode. I'll post an issue for it. However, in the process I could have fixed it. It allows you to inspect the code before you create the pull request.

@@ -96,7 +82,7 @@ func main() {
Name: "basedir",
Aliases: []string{"d"},
Usage: "use workir `DIR`",
Value: ".hhfab",
Value: "~/.hhfab",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value for the workdir is intentional (.hhfab) - it depends on where you run the hhfab binary from and simplifies CI, custom builds and etc. What's your reason to change it?

Copy link
Author

@botchagalupeai botchagalupeai Jul 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I might be in another directory other when I run the build command and it fails. IMHO we should resolve to the default directory no matter where they are. Using ~/.hhfab It will eliminate unnecessary install failures. In my example I was in the .hhfab directory looking at the files when I ran the build and it failed. I had to go to the code to figure out why it failed. That just creates unnecessary toil for first time users. I live by the make the right thing the easy thing.

@Frostman
Copy link
Member

Frostman commented Oct 9, 2024

We're undergoing major rework of the hhfab right now, and it now operates within a folder you're running it (no .hhfab subfolder) - similar to familiar tools like git/terraform/etc.

@Frostman Frostman closed this Oct 9, 2024
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