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