Add edit
command to edit a zettel
Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
This commit is contained in:
parent
1986b9deca
commit
125aa05e0d
5 changed files with 80 additions and 0 deletions
22
internal/lib/run.go
Normal file
22
internal/lib/run.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package lib
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
func Exec(args ...string) error {
|
||||
path, err := exec.LookPath(args[0])
|
||||
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
cmd := exec.Command(path, args[1:]...)
|
||||
cmd.Stderr = os.Stderr
|
||||
cmd.Stdin = os.Stdin
|
||||
cmd.Stdout = os.Stdout
|
||||
|
||||
return cmd.Run()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue