fix copy command

This commit is contained in:
Help-14 2022-04-16 10:08:29 +07:00
parent bdae13d993
commit f5a52c980a
3 changed files with 8 additions and 4 deletions

3
.gitignore vendored
View file

@ -104,4 +104,5 @@ dist
.tern-port
src/temp
src/build
src/build
src/data

View file

@ -1,7 +1,7 @@
services:
magma:
container_name: magma
image: help14/magma
image: magma
restart: unless-stopped
volumes:
- ./data/:/app/data

View file

@ -6,6 +6,7 @@ import (
"log"
"net/http"
"os"
"os/exec"
"path/filepath"
"time"
@ -22,9 +23,11 @@ var websiteData = struct {
func main() {
pwd, _ = os.Getwd()
modules.CopyDirectory("./common", "./data")
appConfig = modules.LoadConfig()
exec.Command("mkdir", "-p", "./data").Run()
exec.Command("cp", "--recursive", "./common/*", "./data/").Run()
appConfig = modules.LoadConfig()
websiteData.Config = appConfig.Website
websiteData.Language = modules.LoadLanguage(appConfig.Website.Language)
websiteData.Contents = modules.LoadContent().Data