Skip to content

Commit

Permalink
Change working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Vedza committed Jan 20, 2021
1 parent 89c451d commit cb68b12
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ require (
github.com/bwmarrin/discordgo v0.22.0
github.com/dgraph-io/ristretto v0.0.3
github.com/fatih/color v1.9.0
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0
github.com/valyala/fasthttp v1.16.0
)
6 changes: 6 additions & 0 deletions sniper.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/bwmarrin/discordgo"
"github.com/dgraph-io/ristretto"
"github.com/fatih/color"
"github.com/kardianos/osext"
"github.com/valyala/fasthttp"
"io/ioutil"
"log"
Expand Down Expand Up @@ -453,6 +454,11 @@ func getPaymentSourceId() {
}
}
func init() {
executablePath, err := osext.ExecutableFolder()
if err != nil {
log.Fatal("Error: Couldn't determine working directory: " + err.Error())
}
os.Chdir(executablePath)
file, err := ioutil.ReadFile("settings.json")
if err != nil {
_, _ = magenta.Print(time.Now().Format("15:04:05 "))
Expand Down

0 comments on commit cb68b12

Please sign in to comment.