Skip to content

Commit

Permalink
get kak executable in commands
Browse files Browse the repository at this point in the history
  • Loading branch information
kkga committed Sep 15, 2021
1 parent b40be31 commit 5226b57
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions kak/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ package kak
import (
"fmt"
"os"
"os/exec"
"syscall"
)

func Connect(kctx *Context, fp *Filepath) error {
kakBinary, err := exec.LookPath("kak")
kakExec, err := kakExec()
if err != nil {
return err
}

kakExecArgs := []string{kakBinary}
kakExecArgs := []string{kakExec}
kakExecArgs = append(kakExecArgs, "-c", kctx.Session.Name)

if fp.Name != "" {
Expand All @@ -27,9 +26,10 @@ func Connect(kctx *Context, fp *Filepath) error {

fmt.Println(kakExecArgs)

execErr := syscall.Exec(kakBinary, kakExecArgs, os.Environ())
execErr := syscall.Exec(kakExec, kakExecArgs, os.Environ())
if execErr != nil {
return execErr
}

return nil
}
8 changes: 4 additions & 4 deletions kak/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ package kak
import (
"fmt"
"os"
"os/exec"
"syscall"
)

func Run(fp *Filepath) error {
kakBinary, err := exec.LookPath("kak")
kakExec, err := kakExec()
if err != nil {
return err
}

kakExecArgs := []string{kakBinary}
kakExecArgs := []string{kakExec}

if fp.Name != "" {
kakExecArgs = append(kakExecArgs, fp.Name)
Expand All @@ -25,9 +24,10 @@ func Run(fp *Filepath) error {

fmt.Println(kakExecArgs)

execErr := syscall.Exec(kakBinary, kakExecArgs, os.Environ())
execErr := syscall.Exec(kakExec, kakExecArgs, os.Environ())
if execErr != nil {
return execErr
}

return nil
}

0 comments on commit 5226b57

Please sign in to comment.