Avatars background job can be started from every directory
This commit is contained in:
parent
092ba2ef0a
commit
fe08764b26
@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"time"
|
||||
@ -29,7 +30,14 @@ func main() {
|
||||
color.Yellow("Generating user avatars")
|
||||
|
||||
// Switch to main directory
|
||||
os.Chdir("../../")
|
||||
exe, err := os.Executable()
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
root := path.Dir(exe)
|
||||
os.Chdir(path.Join(root, "../../"))
|
||||
|
||||
// Log
|
||||
avatarLog.AddOutput(log.File("logs/avatar.log"))
|
||||
|
Loading…
Reference in New Issue
Block a user