Skip to content

Commit 8f9ff7e

Browse files
author
Your
committed
fixed unused app
1 parent 07ff5c6 commit 8f9ff7e

File tree

6 files changed

+12
-16
lines changed

6 files changed

+12
-16
lines changed

internal/core/operations/create/create.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func CreateSystemVariable(args []string, app *appdata.Data) {
7575
return
7676
}
7777

78-
out, err := createhandlers.CreateSystemVariable(newVar, value, app)
78+
out, err := createhandlers.CreateSystemVariable(newVar, value)
7979
if err != nil {
8080
app.Logger.Error(err.Error())
8181
return
@@ -96,7 +96,7 @@ func CreateSystemPathVariable(args []string, app *appdata.Data) {
9696
return
9797
}
9898

99-
out, err := createhandlers.CreateSystemPathVariable(newPath, app)
99+
out, err := createhandlers.CreateSystemPathVariable(newPath)
100100
if err != nil {
101101
app.Logger.Error(err.Error())
102102
return

internal/core/operations/delete/delete.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func DeleteSystemVariable(args []string, app *appdata.Data) {
7575
return
7676
}
7777

78-
out, err := deletehandlers.DeleteSystemVariable(newVar, app)
78+
out, err := deletehandlers.DeleteSystemVariable(newVar)
7979
if err != nil {
8080
app.Logger.Error(err.Error())
8181
return
@@ -96,7 +96,7 @@ func DeleteSystemPathVariable(args []string, app *appdata.Data) {
9696
return
9797
}
9898

99-
out, err := deletehandlers.DeleteSystemPathVariable(newPath, app)
99+
out, err := deletehandlers.DeleteSystemPathVariable(newPath)
100100
if err != nil {
101101
app.Logger.Error(err.Error())
102102
return

internal/handlers/create/create_linux.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ import (
88
"os"
99
"strings"
1010

11-
"github.com/fiwon123/crower/internal/data/app"
1211
"github.com/fiwon123/crower/pkg/crowerutils"
1312
)
1413

15-
func CreateSystemVariable(newVar string, value string, app *app.Data) (string, error) {
14+
func CreateSystemVariable(newVar string, value string) (string, error) {
1615

1716
bashrcPath := os.Getenv("HOME") + "/.bashrc"
1817
fileSlice := crowerutils.GetFileLineSlice(bashrcPath)
@@ -37,7 +36,7 @@ func CreateSystemVariable(newVar string, value string, app *app.Data) (string, e
3736
return "Added to .bashrc. Restart terminal to take effect.", nil
3837
}
3938

40-
func CreateSystemPathVariable(value string, app *app.Data) (string, error) {
39+
func CreateSystemPathVariable(value string) (string, error) {
4140

4241
home := os.Getenv("HOME")
4342
profileFilePath := home + "/.profile"

internal/handlers/create/create_windows.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ import (
77
"os"
88
"os/exec"
99

10-
appdata "github.com/fiwon123/crower/internal/data/app"
1110
"github.com/fiwon123/crower/pkg/crowerutils"
1211
"golang.org/x/sys/windows/registry"
1312
)
1413

15-
func CreateSystemVariable(newVar string, value string, app *appdata.Data) (string, error) {
14+
func CreateSystemVariable(newVar string, value string) (string, error) {
1615
key, err := registry.OpenKey(
1716
registry.CURRENT_USER,
1817
`Environment`,
@@ -38,7 +37,7 @@ func CreateSystemVariable(newVar string, value string, app *appdata.Data) (strin
3837

3938
}
4039

41-
func CreateSystemPathVariable(value string, app *appdata.Data) (string, error) {
40+
func CreateSystemPathVariable(value string) (string, error) {
4241
key, err := registry.OpenKey(
4342
registry.CURRENT_USER,
4443
`Environment`,

internal/handlers/delete/delete_linux.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ import (
77
"os"
88
"strings"
99

10-
"github.com/fiwon123/crower/internal/data/app"
1110
"github.com/fiwon123/crower/pkg/crowerutils"
1211
)
1312

14-
func DeleteSystemVariable(key string, app *app.Data) (string, error) {
13+
func DeleteSystemVariable(key string) (string, error) {
1514
bashrcPath := os.Getenv("HOME") + "/.bashrc"
1615
fileSlice := crowerutils.GetFileLineSlice(bashrcPath)
1716

@@ -36,7 +35,7 @@ func DeleteSystemVariable(key string, app *app.Data) (string, error) {
3635
return "var name deleted", nil
3736
}
3837

39-
func DeleteSystemPathVariable(path string, app *app.Data) (string, error) {
38+
func DeleteSystemPathVariable(path string) (string, error) {
4039
home := os.Getenv("HOME")
4140
profileFilePath := home + "/.profile"
4241
lineSlice := crowerutils.GetFileLineSlice(profileFilePath)

internal/handlers/delete/delete_windows.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ import (
77
"os"
88
"strings"
99

10-
appdata "github.com/fiwon123/crower/internal/data/app"
1110
"github.com/fiwon123/crower/pkg/crowerutils"
1211
"golang.org/x/sys/windows/registry"
1312
)
1413

15-
func DeleteSystemVariable(varName string, app *appdata.Data) (string, error) {
14+
func DeleteSystemVariable(varName string) (string, error) {
1615
key, err := registry.OpenKey(
1716
registry.CURRENT_USER,
1817
`Environment`,
@@ -36,7 +35,7 @@ func DeleteSystemVariable(varName string, app *appdata.Data) (string, error) {
3635
return "var name deleted", nil
3736
}
3837

39-
func DeleteSystemPathVariable(pathValue string, app *appdata.Data) (string, error) {
38+
func DeleteSystemPathVariable(pathValue string) (string, error) {
4039
key, err := registry.OpenKey(
4140
registry.CURRENT_USER,
4241
`Environment`,

0 commit comments

Comments
 (0)