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

Catalog screen freeze on MacOS #2978

Merged
merged 4 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Cleanup
  • Loading branch information
denis256 committed Mar 1, 2024
commit 5318b44e67148ada31a97eb28c88920471d90e20
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ terragrunt: $(shell find . \( -type d -name 'vendor' -prune \) \
-o \( -type f -name '*.go' -print \) )
set -xe ;\
vtag_maybe_extra=$$(git describe --tags --abbrev=12 --dirty --broken) ;\
go build -gcflags="all=-N -l" -o $@ -ldflags "-X github.com/gruntwork-io/go-commons/version.Version=$${vtag_maybe_extra} -extldflags '-static'" .
go build -o $@ -ldflags "-X github.com/gruntwork-io/go-commons/version.Version=$${vtag_maybe_extra} -extldflags '-static'" .

clean:
rm -f terragrunt
Expand Down
8 changes: 1 addition & 7 deletions cli/commands/catalog/tui/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,16 @@ package tui

import (
"context"

tea "github.com/charmbracelet/bubbletea"
"github.com/gruntwork-io/terragrunt/cli/commands/catalog/module"
"github.com/gruntwork-io/terragrunt/cli/commands/catalog/tui/models/list"
"github.com/gruntwork-io/terragrunt/options"
"os"
)

func Run(ctx context.Context, modules module.Modules, opts *options.TerragruntOptions) error {
ctx, cancel := context.WithCancelCause(ctx)
quitFn := func(err error) {
if err != nil {
// write error to /tmp/log.txt file
file, _ := os.OpenFile("/tmp/error.txt", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0666)
file.WriteString(err.Error())
file.Close()
}
go cancel(err)
}

Expand Down
11 changes: 0 additions & 11 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
package main

import (
"log"
"net/http"
"os"

"github.com/gruntwork-io/go-commons/errors"
"github.com/gruntwork-io/terragrunt/cli"
"github.com/gruntwork-io/terragrunt/shell"
"github.com/gruntwork-io/terragrunt/util"
_ "net/http/pprof" // Register pprof handlers with default mux
)

// The main entrypoint for Terragrunt
func main() {

go func() {
log.Println("Starting server on :6060 for pprof")
if err := http.ListenAndServe(":6060", nil); err != nil {
log.Fatalf("Failed to start server: %v", err)
}
}()

defer errors.Recover(checkForErrorsAndExit)

app := cli.NewApp(os.Stdout, os.Stderr)
Expand Down