Skip to content

Commit 0217a88

Browse files
author
tanq
committed
routine update
1 parent 0e48221 commit 0217a88

18 files changed

+107
-298
lines changed

REFACTOR-TEMP/cmd/linux-install.go

-23
This file was deleted.

REFACTOR-TEMP/cmd/linux.go

-18
This file was deleted.

REFACTOR-TEMP/cmd/root.go

+40-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,53 @@
11
package cmd
22

33
import (
4+
"github.com/rs/zerolog/log"
45
"github.com/spf13/cobra"
6+
"github.com/tanq16/cli-productivity-suite/internal"
57
)
68

79
var rootCmd = &cobra.Command{
8-
Use: "cli-productivity-suite",
10+
Use: "cli-suite",
911
Short: "CLI Productivity Suite manager that installs a funky shell and general tools for MacOS and Linux",
1012
}
1113

14+
var linuxCmd = &cobra.Command{
15+
Use: "linux",
16+
Short: "CLI Productivity Suite - Linux operations",
17+
Run: func(cmd *cobra.Command, args []string) {
18+
log.Info().Msg("Linux operations")
19+
},
20+
}
21+
22+
var linuxInstallCmd = &cobra.Command{
23+
Use: "install",
24+
Short: "install CLI stuff for linux",
25+
Run: func(cmd *cobra.Command, args []string) {
26+
log.Info().Msg("Starting installation")
27+
if err := internal.InstallLinux(); err != nil {
28+
log.Fatal().Err(err).Msg("Installation failed")
29+
}
30+
log.Info().Msg("Installation completed successfully")
31+
},
32+
}
33+
34+
var linuxCleanCmd = &cobra.Command{
35+
Use: "clean",
36+
Short: "remove CLI stuff for linux",
37+
Run: func(cmd *cobra.Command, args []string) {
38+
log.Info().Msg("Starting installation")
39+
if err := internal.CleanLinux(); err != nil {
40+
log.Fatal().Err(err).Msg("Installation failed")
41+
}
42+
log.Info().Msg("Installation completed successfully")
43+
},
44+
}
45+
46+
func init() {
47+
rootCmd.AddCommand(linuxCmd)
48+
linuxCmd.AddCommand(linuxInstallCmd)
49+
}
50+
1251
func Execute() error {
1352
return rootCmd.Execute()
1453
}

REFACTOR-TEMP/internal/debian/delete.go

-1
This file was deleted.

REFACTOR-TEMP/internal/installer/darwin.go

-75
This file was deleted.

REFACTOR-TEMP/internal/installer/installer.go

-33
This file was deleted.

REFACTOR-TEMP/internal/installer/linux.go

-76
This file was deleted.

REFACTOR-TEMP/internal/installer/types.go

-21
This file was deleted.

REFACTOR-TEMP/internal/installer/common.go REFACTOR-TEMP/internal/linux.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package installer
1+
package internal
22

33
import (
44
"bufio"
@@ -8,7 +8,7 @@ import (
88
"strings"
99

1010
"github.com/rs/zerolog/log"
11-
"github.com/tanq16/cli-productivity-suite/internal/utils"
11+
"github.com/tanq16/cli-productivity-suite/utils"
1212
)
1313

1414
func InstallOhMyZsh() error {

REFACTOR-TEMP/internal/linux/software.go

-1
This file was deleted.

REFACTOR-TEMP/internal/macos/software.go

-1
This file was deleted.

REFACTOR-TEMP/internal/system/detect.go

-17
This file was deleted.

REFACTOR-TEMP/internal/system/provileges.go REFACTOR-TEMP/utils/additional.go

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
1-
package system
1+
package utils
22

33
import (
44
"os"
55
"os/exec"
6+
"runtime"
67

78
"github.com/rs/zerolog/log"
89
)
910

11+
type SystemInfo struct {
12+
OS string
13+
Arch string
14+
}
15+
16+
func GetSystemInfo() SystemInfo {
17+
return SystemInfo{
18+
OS: runtime.GOOS,
19+
Arch: runtime.GOARCH,
20+
}
21+
}
22+
1023
func CheckRoot() bool {
1124
return os.Geteuid() == 0
1225
}
File renamed without changes.
File renamed without changes.

REFACTOR-TEMP/internal/config/software-list.go REFACTOR-TEMP/utils/vars.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package config
1+
package utils
22

33
var LinuxPackages = []string{
44
"tree",

0 commit comments

Comments
 (0)