Skip to content

Commit

Permalink
[add] packing setup ui
Browse files Browse the repository at this point in the history
  • Loading branch information
trheyi committed Oct 28, 2022
1 parent 93ba063 commit 3e837fb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,14 @@ artifacts-linux: clean
rm -f ../xgen-v1.0/pnpm-lock.yaml
echo "BASE=__yao_admin_root" > ../xgen-v1.0/packages/xgen/.env
cd ../xgen-v1.0 && pnpm install && pnpm run build
# Setup UI
cd ../xgen-v1.0/packages/setup && pnpm install && pnpm run build

# Packing
mkdir -p .tmp/data/xgen
cp -r ./ui .tmp/data/ui
cp -r ../xgen-v0.9/dist .tmp/data/xgen/v0.9
cp -r ../xgen-v1.0/packages/setup/build .tmp/data/xgen/setup
cp -r ../xgen-v1.0/packages/xgen/dist .tmp/data/xgen/v1.0
cp -r yao .tmp/data/
go-bindata -fs -pkg data -o data/bindata.go -prefix ".tmp/data/" .tmp/data/...
Expand Down Expand Up @@ -203,11 +206,15 @@ artifacts-macos: clean
rm -f ../xgen-v1.0/pnpm-lock.yaml
echo "BASE=__yao_admin_root" > ../xgen-v1.0/packages/xgen/.env
cd ../xgen-v1.0 && pnpm install && pnpm run build
# Setup UI
cd ../xgen-v1.0/packages/setup && pnpm install && pnpm run build


# Packing
mkdir -p .tmp/data/xgen
cp -r ./ui .tmp/data/ui
cp -r ../xgen-v0.9/dist .tmp/data/xgen/v0.9
cp -r ../xgen-v1.0/packages/setup/build .tmp/data/xgen/setup
cp -r ../xgen-v1.0/packages/xgen/dist .tmp/data/xgen/v1.0
cp -r yao .tmp/data/
go-bindata -fs -pkg data -o data/bindata.go -prefix ".tmp/data/" .tmp/data/...
Expand Down Expand Up @@ -279,7 +286,7 @@ release: clean
cp -r ./ui .tmp/data/ui
cp -r ./yao .tmp/data/yao
cp -r .tmp/xgen/v0.9/dist .tmp/data/xgen/v0.9
cp -r .tmp/xgen/v1.0/packages/xgen/build .tmp/data/xgen/setup
cp -r .tmp/xgen/v1.0/packages/setup/build .tmp/data/xgen/setup
cp -r .tmp/xgen/v1.0/packages/xgen/dist .tmp/data/xgen/v1.0
go-bindata -fs -pkg data -o data/bindata.go -prefix ".tmp/data/" .tmp/data/...
rm -rf .tmp/data
Expand Down Expand Up @@ -316,11 +323,15 @@ linux-release: clean
echo "BASE=__yao_admin_root" > .tmp/xgen/v1.0/packages/xgen/.env
cd .tmp/xgen/v1.0 && pnpm install && pnpm run build

# Setup UI
cd .tmp/xgen/v1.0/packages/setup && pnpm install && pnpm run build

# Packing
mkdir -p .tmp/data/xgen
cp -r ./ui .tmp/data/ui
cp -r ./yao .tmp/data/yao
cp -r .tmp/xgen/v0.9/dist .tmp/data/xgen/v0.9
cp -r .tmp/xgen/v1.0/packages/setup/build .tmp/data/xgen/setup
cp -r .tmp/xgen/v1.0/packages/xgen/dist .tmp/data/xgen/v1.0
go-bindata -fs -pkg data -o data/bindata.go -prefix ".tmp/data/" .tmp/data/...
rm -rf .tmp/data
Expand Down
15 changes: 13 additions & 2 deletions setup/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,24 @@ func hasInstalled(cfg config.Config) bool {
switch cfg.DB.Driver {

case "sqlite3":
if cfg.DB.Primary != nil {
if cfg.DB.Primary != nil && len(cfg.DB.Primary) > 0 {

dbfile, err := filepath.Abs(cfg.DB.Primary[0])
if err != nil {
return false
}

if _, err := os.Stat(dbfile); err != nil && os.IsNotExist(err) {
fmt.Println(dbfile)
return false
}

return true
}
break

case "mysql":
if cfg.DB.Primary != nil {
if cfg.DB.Primary != nil && len(cfg.DB.Primary) > 0 {
return true
}
break
Expand Down

0 comments on commit 3e837fb

Please sign in to comment.