Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 0 additions & 16 deletions pkg/cli/agent_download.go

This file was deleted.

7 changes: 7 additions & 0 deletions pkg/cli/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,3 +653,10 @@ func stageAllChanges(verbose bool) error {
gitLog.Print("Successfully staged all changes")
return nil
}

func isGHCLIAvailable() bool {
Comment thread
pelikhan marked this conversation as resolved.
Comment thread
pelikhan marked this conversation as resolved.
Comment thread
pelikhan marked this conversation as resolved.
cmd := exec.Command("gh", "--version")
available := cmd.Run() == nil
gitLog.Printf("Checked gh CLI availability: available=%v", available)
Comment thread
pelikhan marked this conversation as resolved.
return available
}
15 changes: 10 additions & 5 deletions pkg/cli/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cli
import (
"fmt"
"os"
"path"
"path/filepath"
"strings"

Expand All @@ -12,13 +13,17 @@ import (

var helpersLog = logger.New("cli:helpers")

// getParentDir returns the directory part of a path
func getParentDir(path string) string {
idx := strings.LastIndex(path, "/")
if idx == -1 {
// getParentDir returns the directory part of a forward-slash workflow path.
// Workflow paths always use forward slashes (e.g. ".github/workflows/foo.md"),
// so path.Dir is correct here; filepath.Dir is not used to avoid OS-specific
// separator handling. Returns "" when the path has no directory component
// (i.e. path.Dir would return ".").
func getParentDir(p string) string {
dir := path.Dir(p)
Comment thread
pelikhan marked this conversation as resolved.
Comment thread
pelikhan marked this conversation as resolved.
if dir == "." {
return ""
}
return path[:idx]
return dir
}

// getRepositoryRelativePath converts an absolute file path to a repository-relative path
Expand Down
Loading