Merge pull request #423 from trheyi/main

fix yao-init & get command
This commit is contained in:
Max 2023-05-18 11:11:49 +08:00 committed by GitHub
commit 46595b8f60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 563 additions and 166 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

@ -52,21 +52,19 @@ YAO adopts a flow-based programming model to implement various functions by writ
3. Use the visual editor to create by "drag and drop"
**Discord:** https://discord.gg/nsKmCXwvxU
**Documentation:** https://yaoapps.com/en-US/doc
## Demo
Applications developed with YAO
| Application | INTRO | REPO |
| ------------------- | ----------------------------------- | -------------------------------------- |
| yaoapp/yao-admin | Admin Dashboard | https://github.com/yaoapp/yao-admin |
| yaoapp/demo-app | Demo Application | https://github.com/yaoapp/demo-app |
| yaoapp/demo-project | Project Management System (Demo) | https://github.com/yaoapp/demo-project |
| yaoapp/demo-finance | Finance Management System (Demo) | https://github.com/yaoapp/demo-finance |
| yaoapp/demo-plm | Production Management System (Demo) | https://github.com/yaoapp/demo-plm |
| Application | Description | Repository |
| -------------------- | ---------------------------------------------------- | --------------------------------------- |
| yaoapp/yao-knowledge | A knowledge base application (Coming soon) | https://github.com/YaoApp/yao-knowledge |
| yaoapp/xgen-dev-app | A demo application | https://github.com/YaoApp/xgen-dev-app |
| yaoapp/demo-project | A demo application for project management | https://github.com/yaoapp/demo-project |
| yaoapp/demo-finance | A demo application for financial management | https://github.com/yaoapp/demo-finance |
| yaoapp/demo-plm | A demo application for production project management | https://github.com/yaoapp/demo-plm |
## Introduce
@ -113,7 +111,7 @@ Create a new project directory, enter the project directory, run the `yao get` c
```bash
mkdir -p /data/app # create project directory
cd /data/app # Enter the project directory
yao get yaoapp/demo-app # download demo-app
yao get yaoapp/demo-plm # download demo-plm
yao start # Start installation
```

View file

@ -32,9 +32,9 @@ YAO 采用 flow-based 的编程模式,通过编写 YAO DSL (JSON 格式逻辑
使用 YAO 开发的应用
| 应用 | 简介 | 代码仓库 |
| ------------------- | -------------------------- | -------------------------------------- |
| yaoapp/yao-admin | 一个通用管理后台 | https://github.com/yaoapp/yao-admin |
| yaoapp/demo-app | 演示应用 (演示) | https://github.com/yaoapp/demo-app |
| -------------------- | --------------------------------------- | --------------------------------------- |
| yaoapp/yao-knowledge | ChatGPT 驱动的知识管理库应用 (稍后开放) | https://github.com/YaoApp/yao-knowledge |
| yaoapp/xgen-dev-app | 演示应用 (演示) | https://github.com/YaoApp/xgen-dev-app |
| yaoapp/demo-project | 工程项目管理演示应用(演示) | https://github.com/yaoapp/demo-project |
| yaoapp/demo-finance | 财务管理演示应用(演示) | https://github.com/yaoapp/demo-finance |
| yaoapp/demo-plm | 生产项目管理演示应用(演示) | https://github.com/yaoapp/demo-plm |
@ -88,7 +88,7 @@ yao start # 启动安装界面
```bash
mkdir -p /data/app # 创建应用目录
cd /data/app # 进入应用目录
yao get yaoapp/demo-app # 下载应用代码 (必须为空目录)
yao get yaoapp/demo-plm # 下载 demo-plm
yao start # 启动安装界面
```

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