Skip to content

Commit f77be1b

Browse files
committed
cleanup
1 parent 20de85f commit f77be1b

File tree

6 files changed

+25
-36
lines changed

6 files changed

+25
-36
lines changed

apps/apps.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (a Apps) brewInstall() error {
104104
return nil
105105
}
106106

107-
func (a Apps) InstallCLI() error {
107+
func (a Apps) Install() error {
108108
if err := xcode(); err != nil {
109109
return fmt.Errorf("cli xcode install: %w", err)
110110
}

apps/gui.go

-5
This file was deleted.

dots/dots.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ package dots
33
import (
44
"fmt"
55

6-
"github.com/Keloran/dotfilesLoader/files"
6+
"github.com/Keloran/dotfilesLoader/console"
7+
"github.com/Keloran/dotfilesLoader/files"
78
)
89

910
type Dots struct {
@@ -20,6 +21,9 @@ func (d Dots) Install() error {
2021
Name string
2122
}
2223

24+
c := console.NewConsole(false)
25+
c.Start("DotFiles")
26+
2327
if d.Github.Repository != "" {
2428
filesLocation, err := files.Downloader{
2529
GithubDetails: d.Github,
@@ -56,6 +60,7 @@ func (d Dots) Install() error {
5660
if err = files.Copy(dot.Location, fmt.Sprintf("%s/%s", d.CurrentDir, dot.Name)); err != nil {
5761
return fmt.Errorf("Dotfiles copy: %w", err)
5862
}
63+
c.Info(fmt.Sprintf("%s Copied", dot.Name))
5964
}
6065
}
6166

@@ -64,6 +69,6 @@ func (d Dots) Install() error {
6469
}
6570
}
6671

67-
fmt.Print("dotfiles installed\n")
72+
c.End("DotFiles")
6873
return nil
6974
}

help.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ func Help() {
1616
BlankLine().
1717
Info("Commands:").
1818
FormattedText(fmt.Sprintf(hFormat, console.Cyan("help"), console.Blue(" This message"))).
19-
FormattedText(fmt.Sprintf(hFormat, console.Cyan("cli"), console.Blue(" Install CLI Apps"))).
20-
FormattedText(fmt.Sprintf(hFormat, console.Cyan("gui"), console.Blue(" Install GUI Apps"))).
19+
FormattedText(fmt.Sprintf(hFormat, console.Cyan("apps"), console.Blue(" Install Apps"))).
2120
FormattedText(fmt.Sprintf(hFormat, console.Cyan("os"), console.Blue(" Install OS Settings"))).
2221
FormattedText(fmt.Sprintf(hFormat, console.Cyan("dots"), console.Blue(" Install the dotfiles"))).
2322
FormattedText(fmt.Sprintf(hFormat, console.Cyan("update"), console.Blue("Run updaters"))).

main.go

+6-26
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func main() {
2929
}
3030
}
3131

32-
var dotfiles, appsGUI, appsCLI, OS, all bool
32+
var dotfiles, appsInstall, OS, all bool
3333
help := true
3434
all = true
3535

@@ -40,12 +40,8 @@ func main() {
4040
dotfiles = true
4141
all = false
4242
help = false
43-
case "gui":
44-
appsGUI = true
45-
all = false
46-
help = false
47-
case "cli":
48-
appsCLI = true
43+
case "apps":
44+
appsInstall = true
4945
help = false
5046
all = false
5147
case "help":
@@ -93,33 +89,17 @@ func main() {
9389
Skip: *skip,
9490
Github: Github,
9591
}
96-
// GUI
97-
if appsGUI {
98-
// need sudo password
99-
if err := app.SetSudo(); err != nil {
100-
console.NewConsole(false).Error(fmt.Sprintf("Sudo err: %+v", err))
101-
}
102-
103-
// GUI install
104-
fmt.Print("Apps GUI\n")
105-
if err = app.InstallGUI(); err != nil {
106-
console.NewConsole(false).Error(fmt.Sprintf("GUI err: %+v", err))
107-
}
108-
109-
fmt.Print("Apps GUI\n")
110-
return
111-
}
11292

11393
// CLI
114-
if appsCLI {
94+
if appsInstall {
11595
// need sudo password
11696
if err := app.SetSudo(); err != nil {
11797
console.NewConsole(false).Error(fmt.Sprintf("Sudo err: %+v", err))
11898
}
11999

120100
// CLI install
121-
fmt.Print("Apps CLI\n")
122-
if err = app.InstallCLI(); err != nil {
101+
fmt.Print("Apps\n")
102+
if err = app.Install(); err != nil {
123103
console.NewConsole(false).Error(fmt.Sprintf("CLI err: %v", err))
124104
}
125105
return

os/os.go

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package os
2+
3+
type OS struct {
4+
Username string
5+
SudoPassword string
6+
Skip bool
7+
Force bool
8+
}
9+
10+

0 commit comments

Comments
 (0)