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 (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
"reflect"
|
"reflect"
|
||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
@ -29,7 +30,14 @@ func main() {
|
|||||||
color.Yellow("Generating user avatars")
|
color.Yellow("Generating user avatars")
|
||||||
|
|
||||||
// Switch to main directory
|
// 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
|
// Log
|
||||||
avatarLog.AddOutput(log.File("logs/avatar.log"))
|
avatarLog.AddOutput(log.File("logs/avatar.log"))
|
||||||
|
Loading…
Reference in New Issue
Block a user