diff --git a/.travis.yml b/.travis.yml index 4c33c3fd2aa22d394ce8d4266f406bc14b300578..8063c8b5b8aac6ee898cecf05cb596ac2a12a47c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,23 +7,8 @@ matrix: - go: 1.5 script: - - GOARCH=amd64 GOOS=linux go build tmplt.go && mv tmplt tmplt_linux_64 && tar czvf tmplt-0.1.0-linux_amd64.tgz tmplt_linux_64 - - GOARCH=amd64 GOOS=darwin go build tmplt.go && mv tmplt tmplt_darwin_64 && tar czvf tmplt-0.1.0-darwin_amd64.tgz tmplt_darwin_64 + - GOARCH=amd64 GOOS=linux go build boilr.go && mv boilr boilr_linux_64 && tar czvf boilr-0.1.0-linux_amd64.tgz boilr_linux_64 + - GOARCH=amd64 GOOS=darwin go build boilr.go && mv boilr boilr_darwin_64 && tar czvf boilr-0.1.0-darwin_amd64.tgz boilr_darwin_64 - - GOARCH=386 GOOS=linux go build tmplt.go && mv tmplt tmplt_linux_32 && tar czvf tmplt-0.1.0-linux_386.tgz tmplt_linux_32 - - GOARCH=386 GOOS=darwin go build tmplt.go && mv tmplt tmplt_darwin_32 && tar czvf tmplt-0.1.0-darwin_386.tgz tmplt_darwin_32 - -deploy: - provider: releases - skip_cleanup: true - - api_key: - secure: W2mjI9R3ZnB7QsYuJitwT/h+7jR/Pj6WSjKERLerRPN0z5nbCCJdTkw7r9gsGBblT2AMHx7qxws2S5AMS4MypJNmOj0ZW5TWiDkobAOENUbjGEjxii2yLuNxcsBE5Ets1s5dPB/RpvHh/PGTC5IX80ISVosRVTQ+ABexuLsFWcG/CpmV/Tb1BxWso3kP2UvupF3XwDJoM2a/hNQXvyzZoO7FVLD/YiWvRNPf9zqrDow3wRAg3YLHqIaHJ2V68rqXb+x/FQ4YpD21tBAAIJc1NSttOXQ3xEyhTMQP0Ba2z+FOvYBVxVJgrBZiV7B6F26GjLHBb104sLTprF6xVQKN6AcPLzgBMO6jZ2apr+On0nglMl4nRbE7TRdEzCZbEzHGxbxAhCdArObuVQN09+MNnUYtJDv/xzkwEpK1NbG/3sEL8zKhJrEYznNWCONKTHgXWp7o8pljOcV4A8nDVKVjul5/VMaZ5Swgs0BQ6QeU+EaprWP6hGuccGLUH+ZX8Wqnl7hV+rRzYIYEeR8d1df3pMUGmnWLJsbI+0K/OcAbqMCmEUBM15XX6+yaHrP1RZQTOKH8F2NR+oVl9EHEQZCt3J4DlSVzB86vkMvXgFuWXq6Q3uJSyUiOnRhGJdykHXNwdvIlkmidyVLIeKTdfCW+I4HoTHBi1/zvmm5sD1Idt2o= - - file: tmplt-0.1.0-darwin_386.tgz - file: tmplt-0.1.0-darwin_amd64.tgz - file: tmplt-0.1.0-linux_386.tgz - file: tmplt-0.1.0-linux_amd64.tgz - - on: - tags: true + - GOARCH=386 GOOS=linux go build boilr.go && mv boilr boilr_linux_32 && tar czvf boilr-0.1.0-linux_386.tgz boilr_linux_32 + - GOARCH=386 GOOS=darwin go build boilr.go && mv boilr boilr_darwin_32 && tar czvf boilr-0.1.0-darwin_386.tgz boilr_darwin_32 diff --git a/README.md b/README.md index d42f9753a6fcdb4f57b37afecff44efcfb46e847..fc4c7789970fd3b1fef507c812958747f2906b97 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# tmplt +# boilr Are you doing the same steps over and over again every time you start a new programming project? -`tmplt` is a powerful language-agnostic command-line project templating scaffolding tool here to help you. +`boilr` is a powerful language-agnostic command-line project templating scaffolding tool here to help you. -For lots of more details, see [the Wiki page](https://github.com/tmrts/tmplt/wiki/Introduction). +For lots of more details, see [the Wiki page](https://github.com/tmrts/boilr/wiki/Introduction). # Features - Blazingly Fast @@ -12,15 +12,15 @@ For lots of more details, see [the Wiki page](https://github.com/tmrts/tmplt/wik # How do I get it? There are binaries available for Linux & OSX. You can download them directly, -or run the installation script. Please see [the Wiki page](https://github.com/tmrts/tmplt/wiki/Installation) for more information. +or run the installation script. Please see [the Wiki page](https://github.com/tmrts/boilr/wiki/Installation) for more information. # Usage To use templates shared by others and create your own please take a look at the -[Usage](https://github.com/tmrts/tmplt/wiki/Usage) and [Creating Templates](https://github.com/tmrts/tmplt/wiki/Creating-Templates) +[Usage](https://github.com/tmrts/boilr/wiki/Usage) and [Creating Templates](https://github.com/tmrts/boilr/wiki/Creating-Templates) pages in the wiki. # Template Catalog -Take a look at [the Wiki page](https://github.com/tmrts/tmplt/wiki/Templates) for a list of project templates, examples, and more information. +Take a look at [the Wiki page](https://github.com/tmrts/boilr/wiki/Templates) for a list of project templates, examples, and more information. # Contributing If you'd like to contribute, share your opinions or learn more, please feel free to open an issue. @@ -28,7 +28,7 @@ If you'd like to contribute, share your opinions or learn more, please feel free At this stage, user feedback is of **utmost importance**, every contribution is welcome however small it may be. ## Reporting Issues -You can report issues **directly from the command-line** by using the command, `tmplt report`. +You can report issues **directly from the command-line** by using the command, `boilr report`. A markdown file will be opened where the first line is the issue title and the rest is the issue body. diff --git a/tmplt.go b/boilr.go similarity index 51% rename from tmplt.go rename to boilr.go index 86b8efe6a083907c9d5e1d9a0e91e0e269c81538..4ffd243e6606f4540d59b0403d453d4c14653d64 100644 --- a/tmplt.go +++ b/boilr.go @@ -1,6 +1,6 @@ package main -import "github.com/tmrts/tmplt/pkg/cmd" +import "github.com/tmrts/boilr/pkg/cmd" func main() { cmd.Run() diff --git a/install b/install index 43eeee2232c6165c6fdd949b1d7e6e352b999f39..363ae3df413cbf5a3023fa5d293583bd3cfe0f3f 100755 --- a/install +++ b/install @@ -20,10 +20,10 @@ ask() { } symlink() { - echo " - Creating symlink: bin/$1 -> bin/tmplt" + echo " - Creating symlink: bin/$1 -> bin/boilr" (cd "$HOME"/bin && - rm -f tmplt && - ln -sf $1 tmplt) + rm -f boilr && + ln -sf $1 boilr) if [ $? -ne 0 ]; then binary_error="Failed to create symlink" return 1 @@ -31,17 +31,17 @@ symlink() { } initialize() { - mkdir -p "$HOME"/.config/tmplt/templates + mkdir -p "$HOME"/.config/boilr/templates if [ $? -ne 0 ]; then - binary_error="Failed to create .config/tmplt directory" + binary_error="Failed to create .config/boilr directory" return fi } check_binary() { - echo -n " - Checking tmplt executable ... " + echo -n " - Checking boilr executable ... " local output - output=$("$HOME"/bin/tmplt version 2>&1) + output=$("$HOME"/bin/boilr version 2>&1) if [ $? -ne 0 ]; then echo "Error: $output" binary_error="Invalid binary" @@ -53,24 +53,24 @@ check_binary() { binary_error="" return 0 fi - rm -f "$HOME"/bin/tmplt + rm -f "$HOME"/bin/boilr return 1 } download() { - echo "Downloading tmplt ..." + echo "Downloading boilr ..." - if [ -x "$HOME"/bin/tmplt ]; then + if [ -x "$HOME"/bin/boilr ]; then echo " - Already exists" check_binary && return fi if [ -x "$HOME"/bin/$1 ]; then symlink $1 && check_binary && return fi - if which_tmplt="$(which tmplt 2> /dev/null)"; then + if which_boilr="$(which boilr 2> /dev/null)"; then echo " - Found in \$PATH" - echo " - Creating symlink: $which_tmplt -> bin/tmplt" - (cd "$HOME"/bin && rm -f tmplt && ln -sf "$which_tmplt" tmplt) + echo " - Creating symlink: $which_boilr -> bin/boilr" + (cd "$HOME"/bin && rm -f boilr && ln -sf "$which_boilr" boilr) check_binary && return fi @@ -80,7 +80,7 @@ download() { return fi - local url=https://github.com/tmrts/tmplt/releases/download/$version/${1}.tgz + local url=https://github.com/tmrts/boilr/releases/download/$version/${1}.tgz if which curl > /dev/null; then curl -fL $url | tar -xz elif which wget > /dev/null; then @@ -105,13 +105,13 @@ binary_error="" case "$archi" in Darwin\ x86_64) download fzf-$version-darwin_${binary_arch:-amd64} ;; Darwin\ i*86) download fzf-$version-darwin_${binary_arch:-386} ;; - Linux\ x86_64) download tmplt-$version-linux_${binary_arch:-amd64} ;; - Linux\ i*86) download tmplt-$version-linux_${binary_arch:-386} ;; + Linux\ x86_64) download boilr-$version-linux_${binary_arch:-amd64} ;; + Linux\ i*86) download boilr-$version-linux_${binary_arch:-386} ;; *) binary_available=0 binary_error=1 ;; esac cat << EOF Completed installation -For more information, see: https://github.com/tmrts/tmplt +For more information, see: https://github.com/tmrts/boilr EOF diff --git a/pkg/tmplt/configuration.go b/pkg/boilr/configuration.go similarity index 86% rename from pkg/tmplt/configuration.go rename to pkg/boilr/configuration.go index c96b19a7594dab8ac853723962fd7e0801df3cbc..036eb1d7aa5355993639008d6b5bbe0f83c3b601 100644 --- a/pkg/tmplt/configuration.go +++ b/pkg/boilr/configuration.go @@ -1,4 +1,4 @@ -package tmplt +package boilr import ( "encoding/json" @@ -7,15 +7,15 @@ import ( "os" "path/filepath" - "github.com/tmrts/tmplt/pkg/util/exit" - "github.com/tmrts/tmplt/pkg/util/osutil" - "github.com/tmrts/tmplt/pkg/util/tlog" + "github.com/tmrts/boilr/pkg/util/exit" + "github.com/tmrts/boilr/pkg/util/osutil" + "github.com/tmrts/boilr/pkg/util/tlog" ) const ( - AppName = "tmplt" + AppName = "boilr" Version = "0.0.1" - ConfigDirPath = ".config/tmplt" + ConfigDirPath = ".config/boilr" ConfigFileName = "config.json" TemplateDir = "templates" @@ -25,7 +25,7 @@ const ( TemplateMetadataName = "__metadata.json" GithubOwner = "tmrts" - GithubRepo = "tmplt" + GithubRepo = "boilr" ) var Configuration = struct { @@ -58,7 +58,7 @@ func init() { return } - // Read .config/tmplt/config.json if exists + // Read .config/boilr/config.json if exists // TODO use defaults if config.json doesn't exist hasConfig, err := osutil.FileExists(Configuration.FilePath) if err != nil { diff --git a/pkg/boilr/errors.go b/pkg/boilr/errors.go new file mode 100644 index 0000000000000000000000000000000000000000..e1e8378aec387a8b78de56a708c2dcc8cb9764fc --- /dev/null +++ b/pkg/boilr/errors.go @@ -0,0 +1,7 @@ +package boilr + +import "errors" + +var ( + ErrTemplateAlreadyExists = errors.New("boilr: project template already exists") +) diff --git a/pkg/cmd/delete.go b/pkg/cmd/delete.go index b2050e9388f3798886f8ba8e63950bba90b2e3e9..69e9c9e695f24d6f324fb0f2bcd7324f3268bc7a 100644 --- a/pkg/cmd/delete.go +++ b/pkg/cmd/delete.go @@ -7,10 +7,10 @@ import ( cli "github.com/spf13/cobra" - "github.com/tmrts/tmplt/pkg/tmplt" - "github.com/tmrts/tmplt/pkg/util/osutil" - "github.com/tmrts/tmplt/pkg/util/tlog" - "github.com/tmrts/tmplt/pkg/util/validate" + "github.com/tmrts/boilr/pkg/boilr" + "github.com/tmrts/boilr/pkg/util/osutil" + "github.com/tmrts/boilr/pkg/util/tlog" + "github.com/tmrts/boilr/pkg/util/validate" ) var Delete = &cli.Command{ @@ -20,7 +20,7 @@ var Delete = &cli.Command{ MustValidateVarArgs(args, validate.Argument{"template-path", validate.Alphanumeric}) for _, templateName := range args { - targetDir := filepath.Join(tmplt.Configuration.TemplateDirPath, templateName) + targetDir := filepath.Join(boilr.Configuration.TemplateDirPath, templateName) switch exists, err := osutil.DirExists(targetDir); { case err != nil: diff --git a/pkg/cmd/download.go b/pkg/cmd/download.go index 35df834692d6df0296268e9b31dae986e332d575..6b4fcc1e6707f6495ca40fcfd457250c081b5f1d 100644 --- a/pkg/cmd/download.go +++ b/pkg/cmd/download.go @@ -12,16 +12,16 @@ import ( cli "github.com/spf13/cobra" - "github.com/tmrts/tmplt/pkg/cmd/util" - "github.com/tmrts/tmplt/pkg/host" - "github.com/tmrts/tmplt/pkg/tmplt" - "github.com/tmrts/tmplt/pkg/util/exit" - "github.com/tmrts/tmplt/pkg/util/osutil" - "github.com/tmrts/tmplt/pkg/util/validate" + "github.com/tmrts/boilr/pkg/boilr" + "github.com/tmrts/boilr/pkg/cmd/util" + "github.com/tmrts/boilr/pkg/host" + "github.com/tmrts/boilr/pkg/util/exit" + "github.com/tmrts/boilr/pkg/util/osutil" + "github.com/tmrts/boilr/pkg/util/validate" ) func downloadZip(URL, targetDir string) error { - f, err := ioutil.TempFile("", "tmplt-download") + f, err := ioutil.TempFile("", "boilr-download") if err != nil { return err } else { @@ -109,7 +109,7 @@ var Download = &cli.Command{ templateURL, templateName := args[0], args[1] - targetDir, err := tmplt.TemplatePath(templateName) + targetDir, err := boilr.TemplatePath(templateName) if err != nil { exit.Error(fmt.Errorf("download: %s", err)) } diff --git a/pkg/cmd/init.go b/pkg/cmd/init.go index a4f6212fb7827c74c0f5c19a904cf2a59e844034..6e7da8d0e4ea3e0827aec17ffc0562258a4154fc 100644 --- a/pkg/cmd/init.go +++ b/pkg/cmd/init.go @@ -5,30 +5,30 @@ import ( "fmt" cli "github.com/spf13/cobra" - "github.com/tmrts/tmplt/pkg/tmplt" - "github.com/tmrts/tmplt/pkg/util/exit" - "github.com/tmrts/tmplt/pkg/util/osutil" + "github.com/tmrts/boilr/pkg/boilr" + "github.com/tmrts/boilr/pkg/util/exit" + "github.com/tmrts/boilr/pkg/util/osutil" ) var ( - ErrUninitializedTmpltDir = errors.New("tmplt: .tmplt directory is not initialized") + ErrUninitializedboilrDir = errors.New("boilr: .boilr directory is not initialized") ) // TODO remove? var Init = &cli.Command{ Use: "init", - Short: "Initialize directories required by tmplt (By default done by installation script)", + Short: "Initialize directories required by boilr (By default done by installation script)", Run: func(c *cli.Command, _ []string) { - // Check if .config/tmplt exists - if exists, err := osutil.DirExists(tmplt.Configuration.TemplateDirPath); exists { + // Check if .config/boilr exists + if exists, err := osutil.DirExists(boilr.Configuration.TemplateDirPath); exists { if shouldRecreate := GetBoolFlag(c, "force"); !shouldRecreate { - exit.Error(ErrUninitializedTmpltDir) + exit.Error(ErrUninitializedboilrDir) } } else if err != nil { exit.Error(fmt.Errorf("init: %s", err)) } - if err := osutil.CreateDirs(tmplt.Configuration.TemplateDirPath); err != nil { + if err := osutil.CreateDirs(boilr.Configuration.TemplateDirPath); err != nil { exit.Error(err) } diff --git a/pkg/cmd/list.go b/pkg/cmd/list.go index f0acff63f11532d3680fdb7b1f7339edcdc9fdb6..cd54ce6f1b49e7f0d60ce33d62c782f4432a9a2d 100644 --- a/pkg/cmd/list.go +++ b/pkg/cmd/list.go @@ -7,14 +7,14 @@ import ( "github.com/olekukonko/tablewriter" cli "github.com/spf13/cobra" - "github.com/tmrts/tmplt/pkg/template" - "github.com/tmrts/tmplt/pkg/tmplt" - "github.com/tmrts/tmplt/pkg/util/exit" - "github.com/tmrts/tmplt/pkg/util/validate" + "github.com/tmrts/boilr/pkg/boilr" + "github.com/tmrts/boilr/pkg/template" + "github.com/tmrts/boilr/pkg/util/exit" + "github.com/tmrts/boilr/pkg/util/validate" ) func ListTemplates() (map[string]bool, error) { - d, err := os.Open(tmplt.Configuration.TemplateDirPath) + d, err := os.Open(boilr.Configuration.TemplateDirPath) if err != nil { return nil, err } else { @@ -47,7 +47,7 @@ var List = &cli.Command{ var data [][]string for name, _ := range templateNames { - tmplPath, err := tmplt.TemplatePath(name) + tmplPath, err := boilr.TemplatePath(name) if err != nil { exit.Fatal(fmt.Errorf("list: %s", err)) } diff --git a/pkg/cmd/metadata.go b/pkg/cmd/metadata.go index df061775e626799de61a0f93dff6832a382b3927..74f27034ffe71492a82ece2baee08638d384d1bc 100644 --- a/pkg/cmd/metadata.go +++ b/pkg/cmd/metadata.go @@ -5,12 +5,12 @@ import ( "os" "path/filepath" - "github.com/tmrts/tmplt/pkg/template" - "github.com/tmrts/tmplt/pkg/tmplt" + "github.com/tmrts/boilr/pkg/boilr" + "github.com/tmrts/boilr/pkg/template" ) func serializeMetadata(tag string, repo string, targetDir string) error { - fname := filepath.Join(targetDir, tmplt.TemplateMetadataName) + fname := filepath.Join(targetDir, boilr.TemplateMetadataName) f, err := os.Create(fname) if err != nil { diff --git a/pkg/cmd/must_validate.go b/pkg/cmd/must_validate.go index 89e2a04221fa0b2e63388e2028916ad2d14e0c72..550d30596b063e33ff497ed77d377c052bc01c09 100644 --- a/pkg/cmd/must_validate.go +++ b/pkg/cmd/must_validate.go @@ -3,9 +3,9 @@ package cmd import ( "fmt" - "github.com/tmrts/tmplt/pkg/cmd/util" - "github.com/tmrts/tmplt/pkg/util/exit" - "github.com/tmrts/tmplt/pkg/util/validate" + "github.com/tmrts/boilr/pkg/cmd/util" + "github.com/tmrts/boilr/pkg/util/exit" + "github.com/tmrts/boilr/pkg/util/validate" ) func MustValidateVarArgs(args []string, v validate.Argument) { diff --git a/pkg/cmd/report.go b/pkg/cmd/report.go index 97f2cf51c4579c9f3977f79846b2e57cc5544cc1..fe94a7403639932e8669dc937b40e438b77b1c4e 100644 --- a/pkg/cmd/report.go +++ b/pkg/cmd/report.go @@ -14,9 +14,9 @@ import ( "github.com/google/go-github/github" cli "github.com/spf13/cobra" - "github.com/tmrts/tmplt/pkg/tmplt" - "github.com/tmrts/tmplt/pkg/util/exit" - "github.com/tmrts/tmplt/pkg/util/validate" + "github.com/tmrts/boilr/pkg/boilr" + "github.com/tmrts/boilr/pkg/util/exit" + "github.com/tmrts/boilr/pkg/util/validate" ) type Transport struct { @@ -52,7 +52,7 @@ func readPassword() (Transport, error) { } func getIssue() (*github.IssueRequest, error) { - dir, err := ioutil.TempDir("", "tmplt-report") + dir, err := ioutil.TempDir("", "boilr-report") if err != nil { return nil, err } else { @@ -132,7 +132,7 @@ func CreateIssue() (string, error) { } client := github.NewClient(t.Client()) - issue, _, err := client.Issues.Create(tmplt.GithubOwner, tmplt.GithubRepo, req) + issue, _, err := client.Issues.Create(boilr.GithubOwner, boilr.GithubRepo, req) if err != nil { return "", err } diff --git a/pkg/cmd/root.go b/pkg/cmd/root.go index 8ae49a73e9cfacd4fea7dc4d04e398cd198be958..bd7e33b5799df04b4212f0aeac164072da533bee 100644 --- a/pkg/cmd/root.go +++ b/pkg/cmd/root.go @@ -3,7 +3,7 @@ package cmd import cli "github.com/spf13/cobra" var Root = &cli.Command{ - Use: "tmplt", + Use: "boilr", } func Run() { diff --git a/pkg/cmd/save.go b/pkg/cmd/save.go index 4e70719627ed7bdb264b6235b31d5f09d4ec33cd..caf2d4d3b669ad302ae4bda99a0d4dfc5ff3344d 100644 --- a/pkg/cmd/save.go +++ b/pkg/cmd/save.go @@ -7,11 +7,11 @@ import ( cli "github.com/spf13/cobra" - "github.com/tmrts/tmplt/pkg/tmplt" - "github.com/tmrts/tmplt/pkg/util/exec" - "github.com/tmrts/tmplt/pkg/util/exit" - "github.com/tmrts/tmplt/pkg/util/osutil" - "github.com/tmrts/tmplt/pkg/util/validate" + "github.com/tmrts/boilr/pkg/boilr" + "github.com/tmrts/boilr/pkg/util/exec" + "github.com/tmrts/boilr/pkg/util/exit" + "github.com/tmrts/boilr/pkg/util/osutil" + "github.com/tmrts/boilr/pkg/util/validate" ) var Save = &cli.Command{ @@ -28,7 +28,7 @@ var Save = &cli.Command{ MustValidateTemplate(tmplDir) - targetDir := filepath.Join(tmplt.Configuration.TemplateDirPath, templateName) + targetDir := filepath.Join(boilr.Configuration.TemplateDirPath, templateName) switch exists, err := osutil.DirExists(targetDir); { case err != nil: diff --git a/pkg/cmd/use.go b/pkg/cmd/use.go index e8fbe391c833927f1b463bdc7c1521c764df5107..39ee8007c2c42d0ffb8f2bf0ab8159896de972c7 100644 --- a/pkg/cmd/use.go +++ b/pkg/cmd/use.go @@ -6,10 +6,10 @@ import ( cli "github.com/spf13/cobra" - "github.com/tmrts/tmplt/pkg/template" - "github.com/tmrts/tmplt/pkg/tmplt" - "github.com/tmrts/tmplt/pkg/util/exit" - "github.com/tmrts/tmplt/pkg/util/validate" + "github.com/tmrts/boilr/pkg/boilr" + "github.com/tmrts/boilr/pkg/template" + "github.com/tmrts/boilr/pkg/util/exit" + "github.com/tmrts/boilr/pkg/util/validate" ) func TemplateInRegistry(name string) (bool, error) { @@ -40,7 +40,7 @@ var Use = &cli.Command{ exit.Fatal(fmt.Errorf("Template %q couldn't be found in the template registry", tmplName)) } - tmplPath, err := tmplt.TemplatePath(tmplName) + tmplPath, err := boilr.TemplatePath(tmplName) if err != nil { exit.Fatal(fmt.Errorf("use: %s", err)) } diff --git a/pkg/cmd/use_test.go b/pkg/cmd/use_test.go index 77f777bf322f45acce099e96d038ccfb537e6224..3557c3c4bdcd912023ed16f3fff0c624f67d33c5 100644 --- a/pkg/cmd/use_test.go +++ b/pkg/cmd/use_test.go @@ -6,7 +6,7 @@ import ( "path/filepath" "testing" - "github.com/tmrts/tmplt/pkg/cmd" + "github.com/tmrts/boilr/pkg/cmd" ) func TestUseExecutesProjectTemplate(t *testing.T) { diff --git a/pkg/cmd/util/validation.go b/pkg/cmd/util/validation.go index b49fb287a1190d5781dd322af149a821047c678f..ac1332a001e6274829a4751a09b14b17a5f82df5 100644 --- a/pkg/cmd/util/validation.go +++ b/pkg/cmd/util/validation.go @@ -7,9 +7,9 @@ import ( "os" "path/filepath" - "github.com/tmrts/tmplt/pkg/template" - "github.com/tmrts/tmplt/pkg/util/osutil" - "github.com/tmrts/tmplt/pkg/util/validate" + "github.com/tmrts/boilr/pkg/template" + "github.com/tmrts/boilr/pkg/util/osutil" + "github.com/tmrts/boilr/pkg/util/validate" ) var ( @@ -63,7 +63,7 @@ func ValidateArgs(args []string, validations []validate.Argument) error { } func testTemplate(path string) error { - tmpDir, err := ioutil.TempDir("", "tmplt-validation-test") + tmpDir, err := ioutil.TempDir("", "boilr-validation-test") if err != nil { return err } else { diff --git a/pkg/cmd/validate.go b/pkg/cmd/validate.go index 7de5abf06f0a1e90128d917bbe278af0f69e8cd7..e0106aa95d7b71136dae4bc093fbe310675feb78 100644 --- a/pkg/cmd/validate.go +++ b/pkg/cmd/validate.go @@ -4,8 +4,8 @@ import ( "errors" cli "github.com/spf13/cobra" - "github.com/tmrts/tmplt/pkg/util/exit" - "github.com/tmrts/tmplt/pkg/util/validate" + "github.com/tmrts/boilr/pkg/util/exit" + "github.com/tmrts/boilr/pkg/util/validate" ) var ( diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go index f7ca582e7666b18999f818efbc23fba4454fc5a0..f7ad63054dfc235adc7e70721a23e51bdbf33c4e 100644 --- a/pkg/cmd/version.go +++ b/pkg/cmd/version.go @@ -5,17 +5,17 @@ import ( cli "github.com/spf13/cobra" - "github.com/tmrts/tmplt/pkg/tmplt" - "github.com/tmrts/tmplt/pkg/util/tlog" - "github.com/tmrts/tmplt/pkg/util/validate" + "github.com/tmrts/boilr/pkg/boilr" + "github.com/tmrts/boilr/pkg/util/tlog" + "github.com/tmrts/boilr/pkg/util/validate" ) var Version = &cli.Command{ Use: "version", - Short: "Show the tmplt version information", + Short: "Show the boilr version information", Run: func(_ *cli.Command, args []string) { MustValidateArgs(args, []validate.Argument{}) - tlog.Info(fmt.Sprint("Current version is ", tmplt.Version)) + tlog.Info(fmt.Sprint("Current version is ", boilr.Version)) }, } diff --git a/pkg/prompt/scan.go b/pkg/prompt/scan.go index 5680bfd5fca354ca9f9531717131d8e6fe6a47aa..5cd3cb4fbf8703162e17013f87bc5e7b3a85acad 100644 --- a/pkg/prompt/scan.go +++ b/pkg/prompt/scan.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/tmrts/tmplt/pkg/util/tlog" + "github.com/tmrts/boilr/pkg/util/tlog" ) const ( diff --git a/pkg/template/metadata_test.go b/pkg/template/metadata_test.go index 6f2e0e1eadb94095a425c1c61dd01fb58898f3e4..286f532e342bbf5a9c5c996a430781b2a21e89ee 100644 --- a/pkg/template/metadata_test.go +++ b/pkg/template/metadata_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/tmrts/tmplt/pkg/template" + "github.com/tmrts/boilr/pkg/template" ) func TestMarshalsTime(t *testing.T) { diff --git a/pkg/template/template.go b/pkg/template/template.go index 14494a3e9f06da35549841e33fa1852555947cb0..0ba71c497a9c69eec0ea85941d42a34fa05978b0 100644 --- a/pkg/template/template.go +++ b/pkg/template/template.go @@ -7,10 +7,10 @@ import ( "path/filepath" "text/template" - "github.com/tmrts/tmplt/pkg/prompt" - "github.com/tmrts/tmplt/pkg/tmplt" - "github.com/tmrts/tmplt/pkg/util/osutil" - "github.com/tmrts/tmplt/pkg/util/stringutil" + "github.com/tmrts/boilr/pkg/boilr" + "github.com/tmrts/boilr/pkg/prompt" + "github.com/tmrts/boilr/pkg/util/osutil" + "github.com/tmrts/boilr/pkg/util/stringutil" ) type Interface interface { @@ -53,9 +53,9 @@ func Get(path string) (Interface, error) { } return metadata, nil - }(filepath.Join(absPath, tmplt.ContextFileName)) + }(filepath.Join(absPath, boilr.ContextFileName)) - metadataExists, err := osutil.FileExists(filepath.Join(absPath, tmplt.TemplateMetadataName)) + metadataExists, err := osutil.FileExists(filepath.Join(absPath, boilr.TemplateMetadataName)) if err != nil { return nil, err } @@ -65,7 +65,7 @@ func Get(path string) (Interface, error) { return Metadata{}, nil } - b, err := ioutil.ReadFile(filepath.Join(absPath, tmplt.TemplateMetadataName)) + b, err := ioutil.ReadFile(filepath.Join(absPath, boilr.TemplateMetadataName)) if err != nil { return Metadata{}, err } @@ -81,7 +81,7 @@ func Get(path string) (Interface, error) { return &dirTemplate{ Context: ctxt, FuncMap: FuncMap, - Path: filepath.Join(absPath, tmplt.TemplateDirName), + Path: filepath.Join(absPath, boilr.TemplateDirName), Metadata: md, }, err } diff --git a/pkg/tmplt/errors.go b/pkg/tmplt/errors.go deleted file mode 100644 index 17675a188eeef589ec62b9a3a0d258cf6dd8120f..0000000000000000000000000000000000000000 --- a/pkg/tmplt/errors.go +++ /dev/null @@ -1,7 +0,0 @@ -package tmplt - -import "errors" - -var ( - ErrTemplateAlreadyExists = errors.New("tmplt: project template already exists") -) diff --git a/pkg/util/exit/exit.go b/pkg/util/exit/exit.go index 90034113918118990cb11163258ce8c472619217..d4cc6a623de1a88b9a724a6d829229f562e54ea8 100644 --- a/pkg/util/exit/exit.go +++ b/pkg/util/exit/exit.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/tmrts/tmplt/pkg/util/tlog" + "github.com/tmrts/boilr/pkg/util/tlog" ) const ( diff --git a/pkg/util/stringutil/stringutil_test.go b/pkg/util/stringutil/stringutil_test.go index c7e88eb6e6047b37ec289922621c6bffce0aadb8..f4777078398f614596d1e290e70f82460f07b77f 100644 --- a/pkg/util/stringutil/stringutil_test.go +++ b/pkg/util/stringutil/stringutil_test.go @@ -3,7 +3,7 @@ package stringutil_test import ( "testing" - "github.com/tmrts/tmplt/pkg/util/stringutil" + "github.com/tmrts/boilr/pkg/util/stringutil" ) func TestReadsFromString(t *testing.T) { diff --git a/pkg/util/tlog/log.go b/pkg/util/tlog/log.go index b20f73487596ee115b02bb686f1970af428f7b9d..e8376d393f5d5d93d92097ccd5430f774578aca3 100644 --- a/pkg/util/tlog/log.go +++ b/pkg/util/tlog/log.go @@ -1,4 +1,4 @@ -// Package tlog implements logging utilities for tmplt +// Package tlog implements logging utilities for boilr package tlog import ( diff --git a/pkg/util/validate/pattern/pattern_test.go b/pkg/util/validate/pattern/pattern_test.go index 95c50fb9038887e52abb4fd715a8ea0783dcae69..e89e77b43867f98e59e14cce22c67b2c4c1dc6ee 100644 --- a/pkg/util/validate/pattern/pattern_test.go +++ b/pkg/util/validate/pattern/pattern_test.go @@ -3,7 +3,7 @@ package pattern_test import ( "testing" - "github.com/tmrts/tmplt/pkg/util/validate/pattern" + "github.com/tmrts/boilr/pkg/util/validate/pattern" ) func TestUnixPathPattern(t *testing.T) { diff --git a/pkg/util/validate/string.go b/pkg/util/validate/string.go index 24c1f88aeac3f89c8264cbc7662e49568bbe059f..a8cf7ed89077b7f03deb9841e3c84c630a74961a 100644 --- a/pkg/util/validate/string.go +++ b/pkg/util/validate/string.go @@ -5,7 +5,7 @@ import ( "runtime" "strings" - "github.com/tmrts/tmplt/pkg/util/validate/pattern" + "github.com/tmrts/boilr/pkg/util/validate/pattern" ) type String func(string) bool