project

package
v0.0.0-...-a01bbdc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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 Create

func Create(p Project, appname string) error

Create accepts anything of interface type Project and calls underlying Create method.

func CreateDir

func CreateDir(dirname string) error

CreateDir create a directory with a given name, only if it doesn't exist.

func GreenText

func GreenText(txt string) string

GreenText prints a given text in red color

func InitIfGitExist

func InitIfGitExist(projectdir string) bool

InitIfGitExist initializes the given projectdir if git exists in the path

func InitialCommit

func InitialCommit(projectdir string) bool

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

func ParseTemplateString(tpl string, t *template.Template, data interface{}) string

ParseTemplateString parses a string-template, fills in data and returns corresponding string

func RedText

func RedText(txt string) string

RedText prints a given text in red color

func SanitizeInput

func SanitizeInput(input string) string

SanitizeInput accepts a language string, checks if its allowed. If its allowed, returns a lowercase representation else error.

func WriteToFile

func WriteToFile(filepath string, data string) error

WriteToFile writes a given `data` string to a `filepath`.

Types

type Dict

type Dict map[string]string

Dict is a dict of string keys to string values

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

type Project

type Project interface {

	// Create will be implemented by structs which want to create
	// a directory structure for a given language eg. Python.
	Create(appname string) error
}

Project interface to support creation of different projects.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL