Documentation ¶
Index ¶
- Constants
- func Create(p Project, appname string) error
- func CreateDir(dirname string) error
- func GreenText(txt string) string
- func InitIfGitExist(projectdir string) bool
- func InitialCommit(projectdir string) bool
- func MustCreateDir(dirpath string)
- func ParseTemplateString(tpl string, t *template.Template, data interface{}) string
- func RedText(txt string) string
- func SanitizeInput(input string) string
- func WriteToFile(filepath string, data string) error
- type Dict
- type Info
- type Project
Constants ¶
View Source
const ( // SignSuccess represents that a task is done SignSuccess = "√" // SignFailure represents that a task is pending SignFailure = "x" )
Variables ¶
This section is empty.
Functions ¶
func InitIfGitExist ¶
InitIfGitExist initializes the given projectdir if git exists in the path
func InitialCommit ¶
InitialCommit creates the first commit with commmit message "first-commit"
func MustCreateDir ¶
func MustCreateDir(dirpath string)
MustCreateDir creates a directory with given name/path. Panics if the directory already exists.
func ParseTemplateString ¶
ParseTemplateString parses a string-template, fills in data and returns corresponding string
func SanitizeInput ¶
SanitizeInput accepts a language string, checks if its allowed. If its allowed, returns a lowercase representation else error.
func WriteToFile ¶
WriteToFile writes a given `data` string to a `filepath`.
Types ¶
type Info ¶
type Info struct { // License represents a string like "MIT" or "Apache2" License string // Author represents the full name of author. For eg. Tova Lanre Author string // Authoremail represents the email of the author in case anyone needs to contact Authoremail string // Scm is source code management, for eg. github.com, gitlab.com, bitbucket.com Scm string // ScmUserName represents a username, for eg. github.com/spf13 => then spf13 ScmUserName string }
Info represents bunch of information associated with a project
Click to show internal directories.
Click to hide internal directories.