Skip to content

Commit 97637ce

Browse files
authored
[minor] surface debug info (#4)
1 parent 153c08e commit 97637ce

11 files changed

Lines changed: 765 additions & 20 deletions

File tree

Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
.PHONY: build deps lint test
1+
.PHONY: build deps lint test work install
22

33
BINARY_NAME=sitectl-drupal
4+
INSTALL_DIR ?= $(or $(dir $(shell which $(BINARY_NAME) 2>/dev/null)),/usr/local/bin/)
45

5-
deps:
6-
go get .
6+
deps: work
77
go mod tidy
88

99
build: deps
1010
go build -o $(BINARY_NAME) .
1111

12+
install: work build
13+
sudo cp $(BINARY_NAME) $(INSTALL_DIR)$(BINARY_NAME)
14+
1215
lint:
1316
go fmt ./...
1417
golangci-lint run
@@ -22,3 +25,6 @@ lint:
2225

2326
test: build
2427
go test -v -race ./...
28+
29+
work:
30+
./scripts/use-go-work.sh

cmd/backup.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cmd
22

33
import (
4-
"context"
54
"fmt"
65
"time"
76

@@ -58,7 +57,7 @@ Example:
5857
cmdArgs = append(cmdArgs, extraFlag)
5958
}
6059

61-
exitCode, err := sdk.ExecInContainerInteractive(context.Background(), containerName, cmdArgs)
60+
exitCode, err := cli.ExecInteractive(cmd.Context(), containerName, cmdArgs)
6261
if err != nil {
6362
return err
6463
}

cmd/drush.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cmd
22

33
import (
4-
"context"
54
"fmt"
65

76
"github.com/kballard/go-shellquote"
@@ -41,7 +40,7 @@ Examples:
4140
drushCmd := []string{"bash", "-c", fmt.Sprintf("drush %s", shellquote.Join(filteredArgs...))}
4241

4342
// Execute the command interactively using SDK helper
44-
exitCode, err := sdk.ExecInContainerInteractive(context.Background(), containerName, drushCmd)
43+
exitCode, err := cli.ExecInteractive(cmd.Context(), containerName, drushCmd)
4544
if err != nil {
4645
return err
4746
}

0 commit comments

Comments
 (0)