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

Release version 0.2.0

parent 0bfd83ec
Branches
Tags 0.2.0
No related merge requests found
......@@ -3,7 +3,7 @@ sudo: false
matrix:
include:
- go: 1.5
env: VERSION=0.1.0
env: VERSION=0.2.0
before_deploy:
- GOARCH=amd64 GOOS=linux go build boilr.go && tar czvf boilr-$VERSION-linux_amd64.tgz boilr
......
......@@ -7,7 +7,7 @@
[Travis]: http://travis-ci.org/tmrts/boilr
[License Widget]: https://img.shields.io/badge/license-Apache%20License%202.0-E91E63.svg?style=flat-square
[License]: https://github.com/tmrts/boilr/blob/master/LICENSE
[Release Widget]: https://img.shields.io/badge/release-v0.1.0-blue.svg?style=flat-square
[Release Widget]: https://img.shields.io/badge/release-v0.2.0-blue.svg?style=flat-square
[Release]: https://github.com/tmrts/boilr/releases
[Gitter Widget]: https://img.shields.io/badge/chat-on%20gitter-00BCD4.svg?style=flat-square
[Gitter]: https://gitter.im/tmrts/boilr
......@@ -20,6 +20,8 @@ Are you doing the same steps over and over again every time you start a new prog
`boilr` is a powerful language-agnostic command-line boilerplate template tool here to help you.
![Usage Demonstration](usage.gif)
For more details, see [Introduction](https://github.com/tmrts/boilr/wiki/Introduction) page.
# Features
......@@ -28,17 +30,51 @@ For more details, see [Introduction](https://github.com/tmrts/boilr/wiki/Introdu
- Full power of [golang templates](https://golang.org/pkg/text/template/) (Easy to learn & powerful)
# Usage
To use templates shared by others and create your own please take a look at the
[Usage](https://github.com/tmrts/boilr/wiki/Usage) and [Creating Templates](https://github.com/tmrts/boilr/wiki/Creating-Templates)
pages in the wiki.
Use `boilr help` to get the list of available commands.
# Template Catalog
Take a look at [Templates](https://github.com/tmrts/boilr/wiki/Templates) page for a list of project templates, examples, and more information.
## Download a Template
In order to download a template from a github repository, use the following command:
# Contributing
If you'd like to contribute, share your opinions or learn more, please feel free to open an issue.
```bash
boilr template download <github-repo-path> <template-tag>
boilr template download tmrts/boilr-license license
```
At this stage, user feedback is of **utmost importance**, every contribution is welcome however small it may be.
The downloaded template will be saved to local `boilr` registry.
## Save a Local Template
In order to save a template from filesystem to the template registry use the following command:
```bash
boilr template save <template-path> <template-tag>
boilr template save ~/boilr-license license
```
The saved template will be saved to local `boilr` registry.
## Use a Template
In order to use a template from template registry use the following command:
```bash
boilr template use <template-tag> <target-dir>
boilr template use license ~/Workspace/example-project/
```
You will be prompted for values when using a template.
```bash
[?] Please choose an option for "License"
1 - "Apache Software License 2.0"
2 - "MIT"
3 - "GNU GPL v3.0"
Select from 1..3 [default: 1]: 2
[?] Please choose a value for "Year" [default: "2015"]:
[?] Please choose a value for "Author" [default: "Tamer Tas"]:
[✔] Created /home/tmrts/project/LICENSE
[✔] Successfully executed the project template license in /home/tmrts/project
```
For more information please take a look at [Usage](https://github.com/tmrts/boilr/wiki/Usage) and [Creating Templates](https://github.com/tmrts/boilr/wiki/Creating-Templates) pages in the wiki.
## Reporting Issues
You can report issues **directly from the command-line** by using the command, `boilr report`.
......@@ -49,6 +85,14 @@ is the issue body.
After creating the issue, save & exit the editor and you will be
prompted for github credentials needed to create the issue.
# Template Catalog
Take a look at [Templates](https://github.com/tmrts/boilr/wiki/Templates) page 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.
At this stage, user feedback is of **utmost importance**, every contribution is welcome however small it may be.
# How Do I Get It?
There are binaries available for Linux & OSX. You can download them directly,
or run the installation script. Please see [Installation](https://github.com/tmrts/boilr/wiki/Installation) page for more information.
......@@ -2,8 +2,8 @@
set -u
[[ "$@" =~ --pre ]] && version=0.1.0 pre=1 ||
version=0.1.0 pre=0
[[ "$@" =~ --pre ]] && version=0.2.0 pre=1 ||
version=0.2.0 pre=0
# If stdin is a tty, we are "interactive".
interactive=
......@@ -37,7 +37,7 @@ configure() {
auto_completion=$?
fi
if [ $auto_completion -eq ]; then
if [ $auto_completion -eq 1 ]; then
sudo $HOME/bin/boilr configure-bash-completion
fi
......@@ -51,7 +51,7 @@ configure() {
check_binary() {
echo -n " - Checking boilr executable ... "
local output
output=$("$HOME"/bin/boilr version 2>&1)
output=$("$HOME"/bin/boilr version --dont-prettify 2>&1)
if [ $? -ne 0 ]; then
echo "Error: $output"
binary_error="Invalid binary"
......
......@@ -16,7 +16,7 @@ const (
AppName = "boilr"
// Version of the application
Version = "0.1.0"
Version = "0.2.0"
// ConfigDirPath is the configuration directory of the application
ConfigDirPath = ".config/boilr"
......
......@@ -144,6 +144,6 @@ var Download = &cli.Command{
exit.Error(fmt.Errorf("download: %s", err))
}
exit.OK("Successfully downloaded the template %v", templateName)
exit.OK("Successfully downloaded the template %#v", templateName)
},
}
package cmd
import (
"errors"
"fmt"
cli "github.com/spf13/cobra"
......@@ -10,11 +9,6 @@ import (
"github.com/tmrts/boilr/pkg/util/osutil"
)
var (
// ErrUninitializedboilrDir indicates that the local template registry is not initialized for boilr.
ErrUninitializedboilrDir = errors.New("boilr: .boilr directory is not initialized")
)
// Init contains the cli-command for initializing the local template
// registry in case it's not initialized.
var Init = &cli.Command{
......@@ -24,7 +18,7 @@ var Init = &cli.Command{
// Check if .config/boilr exists
if exists, err := osutil.DirExists(boilr.Configuration.TemplateDirPath); exists {
if shouldRecreate := GetBoolFlag(c, "force"); !shouldRecreate {
exit.Error(ErrUninitializedboilrDir)
exit.GoodEnough("template registry is already initialized use -f to reinitialize")
}
} else if err != nil {
exit.Error(fmt.Errorf("init: %s", err))
......
......@@ -71,8 +71,7 @@ func getIssue() (*github.IssueRequest, error) {
}
f.Close()
// TODO allow gedit, vi, emacs
cmd := exec.Command("vim", fname)
cmd := exec.Command("vi", fname)
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
......
......@@ -13,7 +13,6 @@ func Run() {
// TODO use command factories instead of global command variables
// TODO add describe command that shows template metadata information
// TODO add create command that creates a minimal template template
// TODO rename template-tag to template-tag
Template := &cli.Command{
Use: "template",
......
......@@ -16,7 +16,6 @@ import (
// Save contains the cli-command for saving templates to template registry.
var Save = &cli.Command{
// TODO rename template-tag to template-tag
Use: "save <template-path> <template-tag>",
Short: "Save a project template to local template registry",
Run: func(c *cli.Command, args []string) {
......@@ -53,7 +52,6 @@ var Save = &cli.Command{
}
if _, err := exec.Cmd("cp", "-r", tmplDir, targetDir); err != nil {
// TODO create exec package
exit.Error(err)
}
......
......@@ -3,6 +3,7 @@ package cmd
import (
"fmt"
"os"
"path/filepath"
cli "github.com/spf13/cobra"
......@@ -36,7 +37,11 @@ var Use = &cli.Command{
MustValidateTemplateDir()
tmplName, targetDir := args[0], args[1]
tmplName := args[0]
targetDir, err := filepath.Abs(args[1])
if err != nil {
exit.Fatal(fmt.Errorf("use: %s", err))
}
if ok, err := TemplateInRegistry(tmplName); err != nil {
exit.Fatal(fmt.Errorf("use: %s", err))
......
......@@ -10,7 +10,6 @@ import (
"github.com/tmrts/boilr/pkg/util/tlog"
)
// TODO align brackets used in the prompt message
const (
// PromptFormatMessage is a format message for value prompts.
PromptFormatMessage = "Please choose a value for %q"
......@@ -36,8 +35,6 @@ func newString(name string, defval interface{}) func() interface{} {
return func() interface{} {
if cache == nil {
cache = func() interface{} {
// TODO use colored prompts
//fmt.Printf(PromptFormatMessage, name, defval)
tlog.Prompt(fmt.Sprintf(PromptFormatMessage, name), defval)
line, err := scanLine()
......
......@@ -195,10 +195,10 @@ func (t *dirTemplate) Execute(dirPrefix string) error {
if err := contentsTmpl.ExecuteTemplate(f, fileTemplateName, nil); err != nil {
return err
}
}
if !t.ShouldUseDefaults {
tlog.Success(fmt.Sprintf("Created %s", target))
if !t.ShouldUseDefaults {
tlog.Success(fmt.Sprintf("Created %s", target))
}
}
return nil
......
......@@ -34,7 +34,7 @@ func Error(err error) {
// GoodEnough terminates execution successfully, but indicates that something is missing.
func GoodEnough(fmtStr string, s ...interface{}) {
tlog.Debug(fmt.Sprintf(fmtStr, s...))
tlog.Info(fmt.Sprintf(fmtStr, s...))
os.Exit(CodeOK)
}
......
......@@ -26,7 +26,6 @@ const (
ErrorMark = "✘"
// QuestionMark character indicates prompt message.
// TODO use for prompts
QuestionMark = "?"
)
......
usage.gif 0 → 100644
usage.gif

1.23 MiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment