Skip to content

Commit

Permalink
cmd/get: Fix git clone and use -F in tail.
Browse files Browse the repository at this point in the history
Git clone fails when git branch is not given in
get, in the past leaving the branch blank worked but
now it expects a specific branch name. So we will be
using main as the default branch name. Also we will use
-F flag in tail command to retry when the file is deleted.

Signed-off-by: Divya Antony J.R <[email protected]>
  • Loading branch information
antony-jr committed Nov 4, 2023
1 parent 150f048 commit fada4b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions internal/cmd/get/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,9 @@ Local Recipe:

// Parse the string
git_url, git_branch := ParseGitRemoteString(recipe_src)
orig_branch := git_branch

if git_branch == "" {
git_branch = "default"
git_branch = "main"
}

_ = tuiSpinnerMsg.StopMessage()
Expand All @@ -188,7 +187,6 @@ Local Recipe:
remove = true
usedGit = true
gitUrl = git_url
gitBranch = orig_branch

tuiSpinnerMsg.ShowMessage(fmt.Sprintf("Cloning Into %s...", dir))

Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/get/tail.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TailRemoteStdout(host string, privKey string, sum string) chan string {
output := make(chan string)
go func() {
for {
command := fmt.Sprintf("tail -f -n 5 /tmp/%s.ham.stdout \n", sum)
command := fmt.Sprintf("tail -F -n 5 /tmp/%s.ham.stdout \n", sum)
client, err := GetSSHClient(host, privKey)
if err != nil {
time.Sleep(time.Second * time.Duration(5))
Expand Down

0 comments on commit fada4b3

Please sign in to comment.