From a8d0df30c32c7ef69dd8b3c55fdaa69abfffc57c Mon Sep 17 00:00:00 2001 From: zhenorzz Date: Wed, 23 Nov 2022 16:58:30 +0800 Subject: [PATCH] U refactor --- .air.toml | 2 +- build.sh | 8 ++++---- web/package.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.air.toml b/.air.toml index aa947ee..b10cf56 100644 --- a/.air.toml +++ b/.air.toml @@ -5,7 +5,7 @@ tmp_dir = "tmp" [build] args_bin = ["-asset-dir", "./"] bin = "tmp\\main.exe" - cmd = "go build -o ./tmp/main.exe ." + cmd = "go build -o ./tmp/main.exe ./cmd/server/" delay = 1000 exclude_dir = ["tmp", "web", "repository"] exclude_file = [] diff --git a/build.sh b/build.sh index 80e2986..90ef768 100755 --- a/build.sh +++ b/build.sh @@ -5,7 +5,7 @@ read x if [[ $x =~ ^[1-9].[0-9]+.[0-9]+$ ]] then - sed -i -e "s/const appVersion = \"[0-9].[0-9]\+.[0-9]\+\"/const appVersion = \"$x\"/g" main.go + sed -i -e "s/const appVersion = \"[0-9].[0-9]\+.[0-9]\+\"/const appVersion = \"$x\"/g" cmd/server/main.go sed -i -e "s/'[0-9].[0-9]\+.[0-9]\+'/'$x'/g" model/sql/goploy.sql sed -i -e "s/GOPLOY_VER=v[0-9].[0-9]\+.[0-9]\+/GOPLOY_VER=v$x/g" docker/Dockerfile fi @@ -23,10 +23,10 @@ fi echo "Building goploy"; -env GOOS=linux go build -o goploy main.go +env GOOS=linux go build -o goploy cmd/server/main.go -env GOOS=darwin go build -o goploy.mac main.go +env GOOS=darwin go build -o goploy.mac cmd/server/main.go -env GOOS=windows go build -o goploy.exe main.go +env GOOS=windows go build -o goploy.exe cmd/server/main.go diff --git a/web/package.json b/web/package.json index 0cacb93..d92670e 100644 --- a/web/package.json +++ b/web/package.json @@ -4,7 +4,7 @@ "license": "GPL-3.0-or-later", "scripts": { "dev": "vite", - "server": "cd ../ && go run main.go --asset-dir=./", + "server": "cd ../ && go run cmd/server/main.go --asset-dir=./", "air": "cd ../ && air", "build": "vite build" },