init
This commit is contained in:
commit
f6140a1fc3
11 files changed
+308
No files matched your search
+18
@@ -0,0 +1,18 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"gosh/types"
|
||||
"os"
|
||||
|
||||
"github.com/fatih/color"
|
||||
)
|
||||
|
||||
func GoshCat(sh *types.Shell, filename string) types.CmdOutput {
|
||||
data, err := os.ReadFile(filename)
|
||||
red := color.New(color.FgRed).SprintFunc()
|
||||
if err != nil {
|
||||
return types.CmdOutput{Id: 1, Output: red(err)}
|
||||
}
|
||||
|
||||
return types.CmdOutput{Id: 0, Output: string(data)}
|
||||
}
|
||||
Reference in new issue
Block a user