Skip to content

Commit

Permalink
Remove dev path
Browse files Browse the repository at this point in the history
  • Loading branch information
zachhuff386 committed Nov 8, 2023
1 parent b7038ea commit bb81d45
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 70 deletions.
17 changes: 0 additions & 17 deletions cli/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"runtime"

"github.com/dropbox/godropbox/errors"
"github.com/pritunl/pritunl-client-electron/cli/constants"
"github.com/pritunl/pritunl-client-electron/cli/errortypes"
)

Expand Down Expand Up @@ -46,22 +45,6 @@ func GetRootDir() (pth string) {
}

func GetAuthPath() (pth string) {
if constants.Development {
pth = filepath.Join(GetRootDir(), "..", "dev")

err := os.MkdirAll(pth, 0755)
if err != nil {
err = &errortypes.ReadError{
errors.Wrap(err, "utils: Failed to create dev directory"),
}
panic(err)
}

pth = filepath.Join(pth, "auth")

return
}

switch runtime.GOOS {
case "windows":
pth = filepath.Join(GetWinDrive(), "ProgramData", "Pritunl", "auth")
Expand Down
54 changes: 1 addition & 53 deletions service/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"github.com/dropbox/godropbox/container/set"
"github.com/dropbox/godropbox/errors"
"github.com/pritunl/pritunl-client-electron/service/command"
"github.com/pritunl/pritunl-client-electron/service/constants"
"github.com/pritunl/pritunl-client-electron/service/errortypes"
"github.com/pritunl/pritunl-client-electron/service/platform"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -861,15 +860,6 @@ func GetWinDrive() string {
}

func GetAuthPath() (pth string) {
if constants.Development {
pth = filepath.Join(GetRootDir(), "..", "dev")

_ = os.MkdirAll(pth, 0755)

pth = filepath.Join(pth, "auth")
return
}

switch runtime.GOOS {
case "windows":
pth = filepath.Join(GetWinDrive(), "ProgramData", "Pritunl")
Expand All @@ -890,15 +880,6 @@ func GetAuthPath() (pth string) {
}

func GetLogPath() (pth string) {
if constants.Development {
pth = filepath.Join(GetRootDir(), "..", "dev", "log")

_ = os.MkdirAll(pth, 0755)

pth = filepath.Join(pth, "pritunl-client.log")
return
}

switch runtime.GOOS {
case "windows":
pth = filepath.Join(GetWinDrive(), "ProgramData", "Pritunl")
Expand All @@ -919,15 +900,6 @@ func GetLogPath() (pth string) {
}

func GetLogPath2() (pth string) {
if constants.Development {
pth = filepath.Join(GetRootDir(), "..", "dev", "log")

_ = os.MkdirAll(pth, 0755)

pth = filepath.Join(pth, "pritunl-client.log.1")
return
}

switch runtime.GOOS {
case "windows":
pth = filepath.Join(GetWinDrive(), "ProgramData", "Pritunl")
Expand All @@ -948,16 +920,7 @@ func GetLogPath2() (pth string) {
}

func InitTempDir() (err error) {
if constants.Development {
pth := filepath.Join(GetRootDir(), "..", "dev", "tmp")
err = os.MkdirAll(pth, 0755)
if err != nil {
err = &IoError{
errors.Wrap(err, "utils: Failed to create temp directory"),
}
return
}
} else if runtime.GOOS != "windows" {
if runtime.GOOS != "windows" {
pth := filepath.Join(string(filepath.Separator), "tmp", "pritunl")

_ = os.RemoveAll(pth)
Expand All @@ -974,12 +937,6 @@ func InitTempDir() (err error) {
}

func GetTempDir() (pth string, err error) {
if constants.Development {
pth = filepath.Join(GetRootDir(), "..", "dev", "tmp")
err = os.MkdirAll(pth, 0755)
return
}

if runtime.GOOS == "windows" {
pth = filepath.Join(GetWinDrive(), "ProgramData", "Pritunl", "Temp")
err = platform.MkdirSecure(pth)
Expand All @@ -1006,15 +963,6 @@ func GetTempDir() (pth string, err error) {
}

func GetPidPath() (pth string) {
if constants.Development {
pth = filepath.Join(GetRootDir(), "..", "dev")

_ = os.MkdirAll(pth, 0755)

pth = filepath.Join(pth, "pritunl.pid")
return
}

switch runtime.GOOS {
case "linux", "darwin":
pth = filepath.Join(string(filepath.Separator),
Expand Down

0 comments on commit bb81d45

Please sign in to comment.