Skip to content

Commit

Permalink
go-aah/aah#211 fixed init.go file generate for aah v0.10.x and below
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevatkm committed Aug 18, 2018
1 parent 427dd22 commit 37e23ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions aah/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,11 +497,14 @@ func isAuthSchemeSupported(authScheme string) bool {
func checkAndGenerateInitgoFile(importPath, baseDir string) {
initGoFile := filepath.Join(baseDir, "app", "init.go")
if !ess.IsFileExists(initGoFile) {
cliLog.Warn("***** In v0.10 'init.go' file introduced to evolve aah framework." +
" Since its not found, generating 'init.go' file. Please add it to your version control. *****\n")
cliLog.Warn("***** In aah v0.10 'init.go' file introduced to evolve aah framework." +
" Since its not found, generating 'init.go' file. Please add 'init.go' into VCS. *****\n")

aahToolsPath := aahToolsPath()
appTemplatePath := filepath.Join(aahToolsPath.Dir, "app-template")
appTmplBaseDir := inferAppTmplBaseDir()
if ess.IsStrEmpty(appTmplBaseDir) {
aahToolsPath := aahToolsPath()
appTmplBaseDir = filepath.Join(aahToolsPath.Dir, "app-template")
}
appType := typeAPI
if ess.IsFileExists(filepath.Join(baseDir, "views")) {
appType = typeWeb
Expand All @@ -514,7 +517,7 @@ func checkAndGenerateInitgoFile(importPath, baseDir string) {
}

processFile(baseDir, file{
src: filepath.Join(appTemplatePath, "app", "init.go.atmpl"),
src: filepath.Join(appTmplBaseDir, "app", "init.go.atmpl"),
dst: filepath.Join(baseDir, "app", "init.go"),
}, data)
}
Expand Down
2 changes: 1 addition & 1 deletion aah/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

// Version no. of aah framework CLI tool
const Version = "0.12.1"
const Version = "0.12.2"

var (
errVersionNotExists = errors.New("version not exists")
Expand Down

0 comments on commit 37e23ab

Please sign in to comment.