t

ref: master

commands/show.go


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
package commands

import (
	"git.sr.ht/~porcellis/t/models"
	"os"
	"os/exec"
)

func Show(note models.Note) error {
	// TODO: Make this configurable
	cmd := exec.Command("glow", note.Path, "-p")
	cmd.Stdin = nil
	cmd.Stdout = os.NewFile(0, os.DevNull)
	cmd.Stderr = os.Stderr

	return cmd.Run()
}