Skip to content

Commit 96c8853

Browse files
committed
Update lib and improve methods
1 parent 733f55d commit 96c8853

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.21
55
toolchain go1.21.3
66

77
require (
8-
github.com/Tom5521/CmdRunTools v1.2.2
8+
github.com/Tom5521/CmdRunTools v1.5.0
99
github.com/Tom5521/MyGolangTools v0.0.0-20230816231450-36b02638e41c
1010
github.com/gookit/color v1.5.4
1111
gopkg.in/yaml.v3 v3.0.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/Tom5521/CmdRunTools v1.2.2 h1:cAcJRBLs1vAYkV2kN1+6rEnT/889NonI0IBk1u2JFWU=
2-
github.com/Tom5521/CmdRunTools v1.2.2/go.mod h1:/OX3Rx+2i6E0UIYSV2xUrk0uENnQAg6gTXSC9ZpGtz4=
1+
github.com/Tom5521/CmdRunTools v1.5.0 h1:7eV/dxkrvqtv6zgwaMeAEK6QCh3cxcp1wfq0/vt0Y+w=
2+
github.com/Tom5521/CmdRunTools v1.5.0/go.mod h1:plBMPx+TAzHknZ/yX347w7p2Astm0MWrZS9dF/KCR/4=
33
github.com/Tom5521/MyGolangTools v0.0.0-20230816231450-36b02638e41c h1:chvCOXnVMqlAmhYmr3/+W/rjIrP+rjS2YS05b7pXM30=
44
github.com/Tom5521/MyGolangTools v0.0.0-20230816231450-36b02638e41c/go.mod h1:QovXEupbIBTOVIJ97GiRFabS4UJQm+Me4n3D2rkf6vg=
55
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=

src/src.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import (
1616

1717
var (
1818
// Functions
19-
sh = func() command.UnixCmd {
20-
cmd := command.Cmd("")
19+
sh = func() command.Cmd {
20+
cmd := command.Cmd{}
2121
cmd.CustomStd(true, true, true)
2222
//cmd.RunWithShell(true)
2323
return cmd
@@ -93,6 +93,7 @@ func Format() {
9393
swap = partitions.Swap.Format && partitions.Swap.Partition != ""
9494
)
9595
// Format partitions
96+
sh.CustomStd(false, false, true)
9697
if boot {
9798
fmYellow(f("Formatting Boot <%v> fat32", partitions.Boot.Partition))
9899
err = sh.SetAndRun("mkfs.vfat -F 32 " + partitions.Boot.Partition)
@@ -342,8 +343,7 @@ func Keymap() {
342343
fmt.Println(err)
343344
}
344345
if strings.Contains(keys, conf.Keyboard) {
345-
346-
err := sh.SetAndRun(f("echo exit|echo echo KEYMAP=%v > /mnt/etc/vconsole.conf|arch-chroot /mnt", conf.Keyboard))
346+
err := sh.SetAndRun(f("echo KEYMAP=%v > /mnt/etc/vconsole.conf", conf.Keyboard))
347347
if err != nil {
348348
Error("Error setting KEYMAP in vconsole.conf")
349349
}
@@ -379,7 +379,8 @@ func ConfigRootPasswd() {
379379
func FinalCmds() {
380380
var err error
381381
if conf.PostInstallChrootCommands != "" {
382-
err = sh.SetAndRun(f("echo exit|echo %v|arch-chroot /mnt", conf.PostInstallChrootCommands))
382+
sh.SetChroot("/mnt")
383+
err = sh.SetAndRun(conf.PostInstallChrootCommands)
383384
if err != nil {
384385
Error("Error in post-install-chroot cmds")
385386
}

0 commit comments

Comments
 (0)