Skip to content
Snippets Groups Projects
Commit 0797c5c6 authored by Tamer Tas's avatar Tamer Tas
Browse files

Rename tmplt to boilr

parent 5c62afeb
No related branches found
No related tags found
No related merge requests found
......@@ -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
# 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.
......
package main
import "github.com/tmrts/tmplt/pkg/cmd"
import "github.com/tmrts/boilr/pkg/cmd"
func main() {
cmd.Run()
......
......@@ -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
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 {
......
package tmplt
package boilr
import "errors"
var (
ErrTemplateAlreadyExists = errors.New("tmplt: project template already exists")
ErrTemplateAlreadyExists = errors.New("boilr: project template already exists")
)
......@@ -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:
......
......@@ -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))
}
......
......@@ -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)
}
......
......@@ -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))
}
......
......@@ -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 {
......
......@@ -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) {
......
......@@ -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
}
......
......@@ -3,7 +3,7 @@ package cmd
import cli "github.com/spf13/cobra"
var Root = &cli.Command{
Use: "tmplt",
Use: "boilr",
}
func Run() {
......
......@@ -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:
......
......@@ -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))
}
......
......@@ -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) {
......
......@@ -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 {
......
......@@ -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 (
......
......@@ -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))
},
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment