fix(install): Makefile uses go install to match docs (#851)
* fix(install): use go install to match docs Makefile install target now uses 'go install' instead of cp to ~/.local/bin, aligning with documented installation method and GOPATH/GOBIN conventions. Closes: hq-93c Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(beads): set BEADS_DIR for config * test(config,rig): update startup and bd stubs --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
7
Makefile
7
Makefile
@@ -22,11 +22,8 @@ ifeq ($(shell uname),Darwin)
|
||||
@echo "Signed $(BINARY) for macOS"
|
||||
endif
|
||||
|
||||
install: build
|
||||
cp $(BUILD_DIR)/$(BINARY) ~/.local/bin/$(BINARY)
|
||||
ifeq ($(shell uname),Darwin)
|
||||
@codesign -s - -f ~/.local/bin/$(BINARY) 2>/dev/null || true
|
||||
endif
|
||||
install: generate
|
||||
go install -ldflags "$(LDFLAGS)" ./cmd/gt
|
||||
|
||||
clean:
|
||||
rm -f $(BUILD_DIR)/$(BINARY)
|
||||
|
||||
@@ -107,6 +107,7 @@ func EnsureCustomTypes(beadsDir string) error {
|
||||
typesList := strings.Join(constants.BeadsCustomTypesList(), ",")
|
||||
cmd := exec.Command("bd", "config", "set", "types.custom", typesList)
|
||||
cmd.Dir = beadsDir
|
||||
cmd.Env = append(os.Environ(), "BEADS_DIR="+beadsDir)
|
||||
if output, err := cmd.CombinedOutput(); err != nil {
|
||||
return fmt.Errorf("configure custom types in %s: %s: %w",
|
||||
beadsDir, strings.TrimSpace(string(output)), err)
|
||||
|
||||
@@ -981,9 +981,9 @@ func TestBuildAgentStartupCommand(t *testing.T) {
|
||||
// New signature: (role, rig, townRoot, rigPath, prompt)
|
||||
cmd := BuildAgentStartupCommand("witness", "gastown", "", "", "")
|
||||
|
||||
// Should contain environment exports and claude command
|
||||
if !strings.Contains(cmd, "export") {
|
||||
t.Error("expected export in command")
|
||||
// Should contain environment prefix and claude command
|
||||
if !strings.Contains(cmd, "exec env") {
|
||||
t.Error("expected exec env in command")
|
||||
}
|
||||
if !strings.Contains(cmd, "GT_ROLE=witness") {
|
||||
t.Error("expected GT_ROLE=witness in command")
|
||||
|
||||
@@ -503,6 +503,9 @@ case "$cmd" in
|
||||
echo "$id" >> "$AGENT_LOG"
|
||||
printf '{"id":"%s","title":"%s","description":"","issue_type":"agent"}' "$id" "$title"
|
||||
;;
|
||||
config)
|
||||
# Accept config commands
|
||||
;;
|
||||
slot)
|
||||
# Accept slot commands
|
||||
;;
|
||||
@@ -512,7 +515,7 @@ case "$cmd" in
|
||||
;;
|
||||
esac
|
||||
`
|
||||
windowsScript := "@echo off\r\nsetlocal enabledelayedexpansion\r\nif defined BEADS_DIR_LOG (\r\n if defined BEADS_DIR (\r\n echo %BEADS_DIR%>>\"%BEADS_DIR_LOG%\"\r\n ) else (\r\n echo ^<unset^> >>\"%BEADS_DIR_LOG%\"\r\n )\r\n)\r\nset \"cmd=%1\"\r\nset \"arg2=%2\"\r\nset \"arg3=%3\"\r\nif \"%cmd%\"==\"--no-daemon\" (\r\n set \"cmd=%2\"\r\n set \"arg2=%3\"\r\n set \"arg3=%4\"\r\n)\r\nif \"%cmd%\"==\"--allow-stale\" (\r\n set \"cmd=%2\"\r\n set \"arg2=%3\"\r\n set \"arg3=%4\"\r\n)\r\nif \"%cmd%\"==\"show\" (\r\n echo []\r\n exit /b 0\r\n)\r\nif \"%cmd%\"==\"create\" (\r\n set \"id=\"\r\n set \"title=\"\r\n for %%A in (%*) do (\r\n set \"arg=%%~A\"\r\n if /i \"!arg:~0,5!\"==\"--id=\" set \"id=!arg:~5!\"\r\n if /i \"!arg:~0,8!\"==\"--title=\" set \"title=!arg:~8!\"\r\n )\r\n if defined AGENT_LOG (\r\n echo !id!>>\"%AGENT_LOG%\"\r\n )\r\n echo {\"id\":\"!id!\",\"title\":\"!title!\",\"description\":\"\",\"issue_type\":\"agent\"}\r\n exit /b 0\r\n)\r\nif \"%cmd%\"==\"slot\" exit /b 0\r\nexit /b 1\r\n"
|
||||
windowsScript := "@echo off\r\nsetlocal enabledelayedexpansion\r\nif defined BEADS_DIR_LOG (\r\n if defined BEADS_DIR (\r\n echo %BEADS_DIR%>>\"%BEADS_DIR_LOG%\"\r\n ) else (\r\n echo ^<unset^> >>\"%BEADS_DIR_LOG%\"\r\n )\r\n)\r\nset \"cmd=%1\"\r\nset \"arg2=%2\"\r\nset \"arg3=%3\"\r\nif \"%cmd%\"==\"--no-daemon\" (\r\n set \"cmd=%2\"\r\n set \"arg2=%3\"\r\n set \"arg3=%4\"\r\n)\r\nif \"%cmd%\"==\"--allow-stale\" (\r\n set \"cmd=%2\"\r\n set \"arg2=%3\"\r\n set \"arg3=%4\"\r\n)\r\nif \"%cmd%\"==\"show\" (\r\n echo []\r\n exit /b 0\r\n)\r\nif \"%cmd%\"==\"create\" (\r\n set \"id=\"\r\n set \"title=\"\r\n for %%A in (%*) do (\r\n set \"arg=%%~A\"\r\n if /i \"!arg:~0,5!\"==\"--id=\" set \"id=!arg:~5!\"\r\n if /i \"!arg:~0,8!\"==\"--title=\" set \"title=!arg:~8!\"\r\n )\r\n if defined AGENT_LOG (\r\n echo !id!>>\"%AGENT_LOG%\"\r\n )\r\n echo {\"id\":\"!id!\",\"title\":\"!title!\",\"description\":\"\",\"issue_type\":\"agent\"}\r\n exit /b 0\r\n)\r\nif \"%cmd%\"==\"config\" exit /b 0\r\nif \"%cmd%\"==\"slot\" exit /b 0\r\nexit /b 1\r\n"
|
||||
|
||||
binDir := writeFakeBD(t, script, windowsScript)
|
||||
agentLog := filepath.Join(t.TempDir(), "agents.log")
|
||||
|
||||
Reference in New Issue
Block a user