path -> filepath
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Sarah Jamie Lewis 2022-01-18 12:53:55 -08:00
parent 799fc6e621
commit 85af1ad3ba
4 changed files with 10 additions and 11 deletions

2
go.mod
View File

@ -5,7 +5,7 @@ go 1.15
require (
cwtch.im/cwtch v0.14.12
git.openprivacy.ca/cwtch.im/server v1.4.2
git.openprivacy.ca/openprivacy/connectivity v1.8.0
git.openprivacy.ca/openprivacy/connectivity v1.8.1
git.openprivacy.ca/openprivacy/log v1.0.3
github.com/mutecomm/go-sqlcipher/v4 v4.4.2
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect

4
go.sum
View File

@ -26,8 +26,8 @@ git.openprivacy.ca/openprivacy/bine v0.0.4/go.mod h1:13ZqhKyqakDsN/ZkQkIGNULsmLy
git.openprivacy.ca/openprivacy/connectivity v1.5.0/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw=
git.openprivacy.ca/openprivacy/connectivity v1.6.0/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw=
git.openprivacy.ca/openprivacy/connectivity v1.7.0/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw=
git.openprivacy.ca/openprivacy/connectivity v1.8.0 h1:/jnc/2LuUpli2NgeLw6zOAVESHrz5mr10kDCQHyZ7R4=
git.openprivacy.ca/openprivacy/connectivity v1.8.0/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw=
git.openprivacy.ca/openprivacy/connectivity v1.8.1 h1:OjWy+JTAvlrstY8PnGPBp7Ho04JaKHaQ+YdoLwSdaCo=
git.openprivacy.ca/openprivacy/connectivity v1.8.1/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw=
git.openprivacy.ca/openprivacy/log v1.0.2/go.mod h1:gGYK8xHtndRLDymFtmjkG26GaMQNgyhioNS82m812Iw=
git.openprivacy.ca/openprivacy/log v1.0.3 h1:E/PMm4LY+Q9s3aDpfySfEDq/vYQontlvNj/scrPaga0=
git.openprivacy.ca/openprivacy/log v1.0.3/go.mod h1:gGYK8xHtndRLDymFtmjkG26GaMQNgyhioNS82m812Iw=

13
lib.go
View File

@ -11,7 +11,7 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
"path"
path "path/filepath"
"strconv"
constants2 "cwtch.im/cwtch/model/constants"
@ -43,7 +43,6 @@ import (
"encoding/base64"
mrand "math/rand"
"os"
"path/filepath"
"time"
"git.openprivacy.ca/openprivacy/connectivity/tor"
@ -142,7 +141,7 @@ func _startCwtch(appDir string, torPath string) {
if appDir == "~" {
appDir = homeDir
} else if strings.HasPrefix(appDir, "~/") {
appDir = filepath.Join(homeDir, appDir[2:])
appDir = path.Join(homeDir, appDir[2:])
}
// Ensure that the application directory exists...and then initialize settings..
@ -161,7 +160,7 @@ func _startCwtch(appDir string, torPath string) {
log.Infof("Loading Cwtch Directory %v and tor path: %v", appDir, torPath)
log.Infof("making directory %v", appDir)
err = os.MkdirAll(filepath.Join(appDir, "tor"), 0700)
err = os.MkdirAll(path.Join(appDir, "tor"), 0700)
if err != nil {
log.Errorf("error creating tor data directory: %v. Aborting app start up", err)
@ -231,7 +230,7 @@ func buildACN(settings utils.GlobalSettings, torPath string, appDir string) conn
}
log.Infof("making directory %v", appDir)
err = os.MkdirAll(filepath.Join(appDir, "tor"), 0700)
err = os.MkdirAll(path.Join(appDir, "tor"), 0700)
if err != nil {
log.Errorf("error creating tor data directory: %v. Aborting app start up", err)
@ -256,7 +255,7 @@ func buildACN(settings utils.GlobalSettings, torPath string, appDir string) conn
utils.WriteGlobalSettings(settings)
}
err = torrc.Build(filepath.Join(appDir, "tor", "torrc"))
err = torrc.Build(path.Join(appDir, "tor", "torrc"))
if err != nil {
log.Errorf("error constructing torrc: %v", err)
@ -269,7 +268,7 @@ func buildACN(settings utils.GlobalSettings, torPath string, appDir string) conn
// purge data dir directories if we are not using them for a cache
torDir := path.Join(appDir, "tor")
files, err := filepath.Glob(path.Join(torDir, "data-dir-*"))
files, err := path.Glob(path.Join(torDir, "data-dir-*"))
if err != nil {
log.Errorf("could not construct filesystem glob: %v", err)
}

View File

@ -1,6 +1,7 @@
package utils
import (
path "path/filepath"
"sync"
"cwtch.im/cwtch/event"
@ -9,7 +10,6 @@ import (
"encoding/json"
"io/ioutil"
"os"
"path"
"git.openprivacy.ca/openprivacy/log"
)