Skip to content

Commit 733f55d

Browse files
committed
Improve cmd running in main
1 parent da20120 commit 733f55d

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

main.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ import (
66

77
"github.com/Tom5521/ArchLinuxInstaller/data"
88
"github.com/Tom5521/ArchLinuxInstaller/src"
9-
"github.com/Tom5521/MyGolangTools/commands"
9+
"github.com/Tom5521/CmdRunTools/command"
1010
)
1111

12-
var sh = commands.Sh{}
12+
var sh = func() command.UnixCmd {
13+
cmd := command.Cmd("")
14+
cmd.CustomStd(true, true, true)
15+
return cmd
16+
}()
1317

1418
var HelpStr = `
1519
Usage:
@@ -18,6 +22,8 @@ Usage:
1822
Arguments:
1923
- help Print this text
2024
25+
- version Print the current version of the binary
26+
2127
- install Run all the nesesary functions to install completely Arch Linux
2228
2329
- pacstrap Only runs the pacstrap functions
@@ -68,6 +74,8 @@ func main() {
6874
return
6975
}
7076
switch os.Args[1] {
77+
case "version":
78+
fmt.Println()
7179
case "help":
7280
PrintHelp()
7381
case "passwd":
@@ -100,7 +108,7 @@ func main() {
100108
src.Mount()
101109
case "newconfig":
102110
data.NewYamlFile()
103-
err := sh.Cmd("vim " + data.Pfilename)
111+
err := sh.SetAndRun("vim " + data.Pfilename)
104112
if err != nil {
105113
src.Error("Error oppening vim.\n" + err.Error())
106114
}

0 commit comments

Comments
 (0)