get cwd for .env

This commit is contained in:
SowinskiBraeden committed 2023-06-14 09:54:14 -07:00
1 parent 96a2f32523
commit 231e2420c2
2 files changed
+5 -2

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@ A script to automatically handle the backing up of MongoDB databases and optiona
3. Setup your service on your UNIX-based OS, for example an Ubuntu Server.
**i.** Build the project to a binary.
```bash
$ go build
$ go build main.go
```
**ii.** Create a System Service file
```bash
+4 -1
View File
@@ -55,8 +55,11 @@ func UploadToGithub(archiveDir string) {
}
func main() {
path, err := os.Getwd()
Handle(err)
// Load environment variables
godotenv.Load(".env")
godotenv.Load(fmt.Sprintf("%s/.env", path))
var mongoURI string = os.Getenv("mongoURI")
var database_string string = os.Getenv("databases")
var github string = os.Getenv("github")