diff --git a/cmd/add.go b/cmd/add.go index 1364fde..b70d06c 100644 --- a/cmd/add.go +++ b/cmd/add.go @@ -52,13 +52,12 @@ func addProjectActually(project *Project) { //the add Project function allows you to search the json file and save the data concerning the project (name and path) func addProject(project *Project) { //the environment variable is stored in a variable in order to create and find the path.json file in the directory where the app is located - filEnv := os.Getenv("gproject") + filEnv := os.Getenv("goproject") _, errr := os.Open(filEnv + "/path.json") if errr != nil { _, errs := os.Create(filEnv + "/path.json") if errs != nil { panic(errs) - os.Exit(0) } } diff --git a/cmd/go.go b/cmd/go.go index 6018904..49c3dfd 100644 --- a/cmd/go.go +++ b/cmd/go.go @@ -29,7 +29,7 @@ var goCmd = &cobra.Command{ // file and change directory by executing a shell command func goPath(project *string) { //the environment variable is stored in a variable in order to create and find the path.json file in the directory where the app is located - filEnv := os.Getenv("gproject") + filEnv := os.Getenv("goproject") viper.SetConfigName("path") viper.SetConfigType("json") viper.AddConfigPath(filEnv) diff --git a/cmd/ls.go b/cmd/ls.go index c20f898..ffd332d 100644 --- a/cmd/ls.go +++ b/cmd/ls.go @@ -16,7 +16,7 @@ var lsCmd = &cobra.Command{ example: gproject ls`, Run: func(cmd *cobra.Command, args []string) { //the environment variable is stored in a variable in order to create and find the path.json file in the directory where the app is located - filEnv := os.Getenv("gproject") + filEnv := os.Getenv("goproject") file, err := os.ReadFile(filEnv + "/path.json") if err != nil { panic(err) diff --git a/go.mod b/go.mod index b04bbc2..23730f0 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module gproject +module github.com/Dar_rius/goproject go 1.18 diff --git a/main.go b/main.go index c537f75..22a99b5 100644 --- a/main.go +++ b/main.go @@ -3,7 +3,7 @@ Copyright © 2022 NAME HERE */ package main -import "gproject/cmd" +import "github.com/Dar_rius/goproject/cmd" func main() { cmd.Execute()