fix yao-init & get command
This commit is contained in:
parent
5dc712935d
commit
d9b6910227
4 changed files with 547 additions and 148 deletions
18
Makefile
18
Makefile
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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()))
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
666
data/bindata.go
666
data/bindata.go
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue