From 73aa44e1a79eed868f78ddfc69f99e39d2c4c93f Mon Sep 17 00:00:00 2001 From: Faissal Elamraoui Date: Sat, 3 Dec 2016 16:06:46 +0100 Subject: [PATCH] Added a few tweaks to the folder structure in the long description --- apiapp.go | 24 ++++++++++++------------ hproseapp.go | 6 +++--- new.go | 32 ++++++++++++++++---------------- util.go | 11 ++++++----- 4 files changed, 37 insertions(+), 36 deletions(-) diff --git a/apiapp.go b/apiapp.go index 9a1950d..3e2a9be 100644 --- a/apiapp.go +++ b/apiapp.go @@ -36,19 +36,19 @@ var cmdApiapp = &Command{ The command 'api' creates a folder named [appname] with the following structure: - ├── conf - │ └── app.conf - ├── controllers - │ └── object.go - │ └── user.go - ├── routers - │ └── router.go - ├── tests - │ └── default_test.go ├── main.go - └── models - └── object.go - └── user.go + ├── {{"conf"|foldername}} + │ └── app.conf + ├── {{"controllers"|foldername}} + │ └── object.go + │ └── user.go + ├── {{"routers"|foldername}} + │ └── router.go + ├── {{"tests"|foldername}} + │ └── default_test.go + └── {{"models"|foldername}} + └── object.go + └── user.go `, PreRun: func(cmd *Command, args []string) { ShowShortVersionBanner() }, Run: createapi, diff --git a/hproseapp.go b/hproseapp.go index 0df6e1c..edd01b1 100644 --- a/hproseapp.go +++ b/hproseapp.go @@ -37,10 +37,10 @@ var cmdHproseapp = &Command{ The command 'hprose' creates a folder named [appname] with the following structure: - ├── conf - │ └── app.conf ├── main.go - └── models + ├── {{"conf"|foldername}} + │ └── app.conf + └── {{"models"|foldername}} └── object.go └── user.go `, diff --git a/new.go b/new.go index 497ad66..eb3ab60 100644 --- a/new.go +++ b/new.go @@ -29,22 +29,22 @@ Creates a Beego application for the given app name in the current directory. The command 'new' creates a folder named [appname] and generates the following structure: - |- main.go - |- conf - |- app.conf - |- controllers - |- default.go - |- models - |- routers - |- router.go - |- tests - |- default_test.go - |- static - |- js - |- css - |- img - |- views - index.tpl + ├── main.go + ├── {{"conf"|foldername}} + │ └── app.conf + ├── {{"controllers"|foldername}} + │ └── default.go + ├── {{"models"|foldername}} + ├── {{"routers"|foldername}} + │ └── router.go + ├── {{"tests"|foldername}} + │ └── default_test.go + ├── {{"static"|foldername}} + │ └── {{"js"|foldername}} + │ └── {{"css"|foldername}} + │ └── {{"img"|foldername}} + └── {{"views"|foldername}} + └── index.tpl `, PreRun: func(cmd *Command, args []string) { ShowShortVersionBanner() }, diff --git a/util.go b/util.go index fcfaeca..0893144 100644 --- a/util.go +++ b/util.go @@ -287,11 +287,12 @@ func __LINE__() int { // BeeFuncMap returns a FuncMap of functions used in different templates. func BeeFuncMap() template.FuncMap { return template.FuncMap{ - "trim": strings.TrimSpace, - "bold": bold, - "headline": MagentaBold, - "endline": EndLine, - "tmpltostr": TmplToString, + "trim": strings.TrimSpace, + "bold": bold, + "headline": MagentaBold, + "foldername": RedBold, + "endline": EndLine, + "tmpltostr": TmplToString, } }