fix yao-init & get command

This commit is contained in:
Max 2023-05-18 10:58:27 +08:00
parent 5dc712935d
commit d9b6910227
4 changed files with 547 additions and 148 deletions

View file

@ -122,7 +122,7 @@ bindata:
rm -rf .tmp/yao-init/.git
rm -rf .tmp/yao-init/.gitignore
rm -rf .tmp/yao-init/LICENSE
rm -rf .tmp/yao-init/README.md
# rm -rf .tmp/yao-init/README.md
# Copy Files
cp -r .tmp/yao-init .tmp/data/init
@ -149,10 +149,10 @@ artifacts-linux: clean
cd ../xgen-v1.0/packages/setup && pnpm install --no-frozen-lockfile && pnpm run build
# Init Application
cd ../yao-init rm -rf .git
cd ../yao-init rm -rf .gitignore
cd ../yao-init rm -rf LICENSE
cd ../yao-init rm -rf README.md
cd ../yao-init && rm -rf .git
cd ../yao-init && rm -rf .gitignore
cd ../yao-init && rm -rf LICENSE
# cd ../yao-init rm -rf README.md
# Packing
mkdir -p .tmp/data/xgen
@ -198,10 +198,10 @@ artifacts-macos: clean
cd ../xgen-v1.0/packages/setup && pnpm install --no-frozen-lockfile && pnpm run build
# Init Application
cd ../yao-init rm -rf .git
cd ../yao-init rm -rf .gitignore
cd ../yao-init rm -rf LICENSE
cd ../yao-init rm -rf README.md
cd ../yao-init && rm -rf .git
cd ../yao-init && rm -rf .gitignore
cd ../yao-init && rm -rf LICENSE
# cd ../yao-init && rm -rf README.md
# Packing
mkdir -p .tmp/data/xgen

View file

@ -28,8 +28,8 @@ var getCmd = &cobra.Command{
os.Exit(1)
}
fmt.Println(color.WhiteString("From Infra: %s", pkg.Remote))
fmt.Println(color.WhiteString("Visit: https://LetsInfra.com"))
fmt.Println(color.WhiteString("From Yao: %s", pkg.Remote))
fmt.Println(color.WhiteString("Visit: https://yaoapps.com"))
err = pkg.Download()
if err != nil {
fmt.Println(color.RedString(err.Error()))

View file

@ -184,6 +184,11 @@ func (pkg *Package) Unpack(dest string) (*app.DSL, error) {
}
if len(files) > 0 {
for _, f := range files {
if f.Name() != "logs" {
return nil, fmt.Errorf("current folder shoud be empty")
}
}
return nil, fmt.Errorf("current folder shoud be empty")
}
@ -213,7 +218,7 @@ func (pkg *Package) Unpack(dest string) (*app.DSL, error) {
}
}
data, err := os.ReadFile(filepath.Join(path, "app.json"))
data, err := os.ReadFile(filepath.Join(path, "app.yao"))
if err != nil {
return nil, err
}

File diff suppressed because one or more lines are too long