Skip to content

Commit

Permalink
v1.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
pefish committed Dec 13, 2023
1 parent 146e778 commit f6c0bc9
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 17 deletions.
3 changes: 2 additions & 1 deletion cmd/create-app/command/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,10 @@ func (dc *DefaultCommand) Start(data *commander.StartData) error {
return nil
}
params := global.TemplateParams{
PackageName: fmt.Sprintf("%s/%s/%s", domain, username, projectName),
Username: username,
AppName: projectName,
RepoUrl: global.GlobalConfig.Repo,
PackageName: fmt.Sprintf("%s/%s/%s", domain, username, projectName),
}
err := templateInstance.Make(params)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion pkg/global/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ type Config struct {
}

type TemplateParams struct {
AppName string `json:"app_name"`
PackageName string `json:"package_name"`
Username string `json:"username"`
AppName string `json:"app_name"`
RepoUrl string `json:"repo_url"`
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/templates/go_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ set -euxo pipefail
git clone %s --single-branch -v -b main --depth 1 %s
cd %s
rm -rf .git
PACKAGE_NAME="%s" APP_NAME="%s" NAME="%s" ./init.sh
PACKAGE_NAME="%s" APP_NAME="%s" USERNAME="%s" ./init.sh
rm -rf ./init.sh
`,
gat.Url(),
params.AppName,
params.AppName,
params.PackageName,
params.AppName,
params.AppName,
params.Username,
)
cmd := exec.Command("bash", "-c", script)
cmd.Stdout = os.Stdout
Expand Down
4 changes: 2 additions & 2 deletions pkg/templates/go_grpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ set -euxo pipefail
git clone %s --single-branch -v -b main --depth 1 %s
cd %s
rm -rf .git
PACKAGE_NAME="%s" APP_NAME="%s" NAME="%s" ./init.sh
PACKAGE_NAME="%s" APP_NAME="%s" USERNAME="%s" ./init.sh
rm -rf ./init.sh
`,
ggst.Url(),
params.AppName,
params.AppName,
params.PackageName,
params.AppName,
params.AppName,
params.Username,
)
cmd := exec.Command("bash", "-c", script)
cmd.Stdout = os.Stdout
Expand Down
4 changes: 2 additions & 2 deletions pkg/templates/go_lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ set -euxo pipefail
git clone %s --single-branch -v -b main --depth 1 %s
cd %s
rm -rf .git
PACKAGE_NAME="%s" APP_NAME="%s" NAME="%s" ./init.sh
PACKAGE_NAME="%s" APP_NAME="%s" USERNAME="%s" ./init.sh
rm -rf ./init.sh
`,
glt.Url(),
params.AppName,
params.AppName,
params.PackageName,
params.AppName,
params.PackageName,
params.Username,
)
cmd := exec.Command("bash", "-c", script)
cmd.Stdout = os.Stdout
Expand Down
4 changes: 2 additions & 2 deletions pkg/templates/go_web_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ set -euxo pipefail
git clone %s --single-branch -v -b main --depth 1 %s
cd %s
rm -rf .git
PACKAGE_NAME="%s" APP_NAME="%s" NAME="%s" ./init.sh
PACKAGE_NAME="%s" APP_NAME="%s" USERNAME="%s" ./init.sh
rm -rf ./init.sh
`,
gwst.Url(),
params.AppName,
params.AppName,
params.PackageName,
params.AppName,
params.AppName,
params.Username,
)
cmd := exec.Command("bash", "-c", script)
cmd.Stdout = os.Stdout
Expand Down
6 changes: 4 additions & 2 deletions pkg/templates/react_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ set -euxo pipefail
git clone %s --single-branch -v -b main --depth 1 %s
cd %s
rm -rf .git
cat package.json | sed "s/template/%s/g" > temp && rm -rf package.json && mv temp package.json
npm install
PACKAGE_NAME="%s" APP_NAME="%s" USERNAME="%s" ./init.sh
rm -rf ./init.sh
`,
rat.Url(),
params.AppName,
params.AppName,
params.PackageName,
params.AppName,
params.Username,
)
cmd := exec.Command("bash", "-c", script)
cmd.Stdout = os.Stdout
Expand Down
6 changes: 4 additions & 2 deletions pkg/templates/react_dapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ set -euxo pipefail
git clone %s --single-branch -v -b main --depth 1 %s
cd %s
rm -rf .git
cat package.json | sed "s/template/%s/g" > temp && rm -rf package.json && mv temp package.json
npm install
PACKAGE_NAME="%s" APP_NAME="%s" USERNAME="%s" ./init.sh
rm -rf ./init.sh
`,
rdt.Url(),
params.AppName,
params.AppName,
params.PackageName,
params.AppName,
params.Username,
)
cmd := exec.Command("bash", "-c", script)
cmd.Stdout = os.Stdout
Expand Down
4 changes: 2 additions & 2 deletions pkg/templates/rust_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ set -euxo pipefail
git clone %s --single-branch -v -b main --depth 1 %s
cd %s
rm -rf .git
PACKAGE_NAME="%s" APP_NAME="%s" NAME="%s" ./init.sh
PACKAGE_NAME="%s" APP_NAME="%s" USERNAME="%s" ./init.sh
rm -rf ./init.sh
`,
rat.Url(),
params.AppName,
params.AppName,
params.PackageName,
params.AppName,
params.AppName,
params.Username,
)
cmd := exec.Command("bash", "-c", script)
cmd.Stdout = os.Stdout
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package version

const (
AppName = "create-app"
Version = "v1.1.7"
Version = "v1.1.9"
)

0 comments on commit f6c0bc9

Please sign in to comment.