Skip to content

Commit bd036e6

Browse files
committed
Release version 0.2.0
1 parent 0bfd83e commit bd036e6

File tree

15 files changed

+72
-37
lines changed

15 files changed

+72
-37
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ sudo: false
33
matrix:
44
include:
55
- go: 1.5
6-
env: VERSION=0.1.0
6+
env: VERSION=0.2.0
77

88
before_deploy:
99
- GOARCH=amd64 GOOS=linux go build boilr.go && tar czvf boilr-$VERSION-linux_amd64.tgz boilr

README.md

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[Travis]: http://travis-ci.org/tmrts/boilr
88
[License Widget]: https://img.shields.io/badge/license-Apache%20License%202.0-E91E63.svg?style=flat-square
99
[License]: https://github.com/tmrts/boilr/blob/master/LICENSE
10-
[Release Widget]: https://img.shields.io/badge/release-v0.1.0-blue.svg?style=flat-square
10+
[Release Widget]: https://img.shields.io/badge/release-v0.2.0-blue.svg?style=flat-square
1111
[Release]: https://github.com/tmrts/boilr/releases
1212
[Gitter Widget]: https://img.shields.io/badge/chat-on%20gitter-00BCD4.svg?style=flat-square
1313
[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
2020

2121
`boilr` is a powerful language-agnostic command-line boilerplate template tool here to help you.
2222

23+
![Usage Demonstration](usage.gif)
24+
2325
For more details, see [Introduction](https://github.com/tmrts/boilr/wiki/Introduction) page.
2426

2527
# Features
@@ -28,17 +30,51 @@ For more details, see [Introduction](https://github.com/tmrts/boilr/wiki/Introdu
2830
- Full power of [golang templates](https://golang.org/pkg/text/template/) (Easy to learn & powerful)
2931

3032
# Usage
31-
To use templates shared by others and create your own please take a look at the
32-
[Usage](https://github.com/tmrts/boilr/wiki/Usage) and [Creating Templates](https://github.com/tmrts/boilr/wiki/Creating-Templates)
33-
pages in the wiki.
33+
Use `boilr help` to get the list of available commands.
3434

35-
# Template Catalog
36-
Take a look at [Templates](https://github.com/tmrts/boilr/wiki/Templates) page for a list of project templates, examples, and more information.
35+
## Download a Template
36+
In order to download a template from a github repository, use the following command:
3737

38-
# Contributing
39-
If you'd like to contribute, share your opinions or learn more, please feel free to open an issue.
38+
```bash
39+
boilr template download <github-repo-path> <template-tag>
40+
boilr template download tmrts/boilr-license license
41+
```
4042

41-
At this stage, user feedback is of **utmost importance**, every contribution is welcome however small it may be.
43+
The downloaded template will be saved to local `boilr` registry.
44+
45+
## Save a Local Template
46+
In order to save a template from filesystem to the template registry use the following command:
47+
48+
```bash
49+
boilr template save <template-path> <template-tag>
50+
boilr template save ~/boilr-license license
51+
```
52+
53+
The saved template will be saved to local `boilr` registry.
54+
55+
## Use a Template
56+
In order to use a template from template registry use the following command:
57+
58+
```bash
59+
boilr template use <template-tag> <target-dir>
60+
boilr template use license ~/Workspace/example-project/
61+
```
62+
63+
You will be prompted for values when using a template.
64+
65+
```bash
66+
[?] Please choose an option for "License"
67+
1 - "Apache Software License 2.0"
68+
2 - "MIT"
69+
3 - "GNU GPL v3.0"
70+
Select from 1..3 [default: 1]: 2
71+
[?] Please choose a value for "Year" [default: "2015"]:
72+
[?] Please choose a value for "Author" [default: "Tamer Tas"]:
73+
[✔] Created /home/tmrts/project/LICENSE
74+
[✔] Successfully executed the project template license in /home/tmrts/project
75+
```
76+
77+
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.
4278

4379
## Reporting Issues
4480
You can report issues **directly from the command-line** by using the command, `boilr report`.
@@ -49,6 +85,14 @@ is the issue body.
4985
After creating the issue, save & exit the editor and you will be
5086
prompted for github credentials needed to create the issue.
5187

88+
# Template Catalog
89+
Take a look at [Templates](https://github.com/tmrts/boilr/wiki/Templates) page for a list of project templates, examples, and more information.
90+
91+
# Contributing
92+
If you'd like to contribute, share your opinions or learn more, please feel free to open an issue.
93+
94+
At this stage, user feedback is of **utmost importance**, every contribution is welcome however small it may be.
95+
5296
# How Do I Get It?
5397
There are binaries available for Linux & OSX. You can download them directly,
5498
or run the installation script. Please see [Installation](https://github.com/tmrts/boilr/wiki/Installation) page for more information.

install

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
set -u
44

5-
[[ "$@" =~ --pre ]] && version=0.1.0 pre=1 ||
6-
version=0.1.0 pre=0
5+
[[ "$@" =~ --pre ]] && version=0.2.0 pre=1 ||
6+
version=0.2.0 pre=0
77

88
# If stdin is a tty, we are "interactive".
99
interactive=
@@ -37,7 +37,7 @@ configure() {
3737
auto_completion=$?
3838
fi
3939

40-
if [ $auto_completion -eq ]; then
40+
if [ $auto_completion -eq 1 ]; then
4141
sudo $HOME/bin/boilr configure-bash-completion
4242
fi
4343

@@ -51,7 +51,7 @@ configure() {
5151
check_binary() {
5252
echo -n " - Checking boilr executable ... "
5353
local output
54-
output=$("$HOME"/bin/boilr version 2>&1)
54+
output=$("$HOME"/bin/boilr version --dont-prettify 2>&1)
5555
if [ $? -ne 0 ]; then
5656
echo "Error: $output"
5757
binary_error="Invalid binary"

pkg/boilr/configuration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const (
1616
AppName = "boilr"
1717

1818
// Version of the application
19-
Version = "0.1.0"
19+
Version = "0.2.0"
2020

2121
// ConfigDirPath is the configuration directory of the application
2222
ConfigDirPath = ".config/boilr"

pkg/cmd/download.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,6 @@ var Download = &cli.Command{
144144
exit.Error(fmt.Errorf("download: %s", err))
145145
}
146146

147-
exit.OK("Successfully downloaded the template %v", templateName)
147+
exit.OK("Successfully downloaded the template %#v", templateName)
148148
},
149149
}

pkg/cmd/init.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cmd
22

33
import (
4-
"errors"
54
"fmt"
65

76
cli "github.com/spf13/cobra"
@@ -10,11 +9,6 @@ import (
109
"github.com/tmrts/boilr/pkg/util/osutil"
1110
)
1211

13-
var (
14-
// ErrUninitializedboilrDir indicates that the local template registry is not initialized for boilr.
15-
ErrUninitializedboilrDir = errors.New("boilr: .boilr directory is not initialized")
16-
)
17-
1812
// Init contains the cli-command for initializing the local template
1913
// registry in case it's not initialized.
2014
var Init = &cli.Command{
@@ -24,7 +18,7 @@ var Init = &cli.Command{
2418
// Check if .config/boilr exists
2519
if exists, err := osutil.DirExists(boilr.Configuration.TemplateDirPath); exists {
2620
if shouldRecreate := GetBoolFlag(c, "force"); !shouldRecreate {
27-
exit.Error(ErrUninitializedboilrDir)
21+
exit.GoodEnough("template registry is already initialized use -f to reinitialize")
2822
}
2923
} else if err != nil {
3024
exit.Error(fmt.Errorf("init: %s", err))

pkg/cmd/report.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ func getIssue() (*github.IssueRequest, error) {
7171
}
7272
f.Close()
7373

74-
// TODO allow gedit, vi, emacs
75-
cmd := exec.Command("vim", fname)
74+
cmd := exec.Command("vi", fname)
7675

7776
cmd.Stdin = os.Stdin
7877
cmd.Stdout = os.Stdout

pkg/cmd/root.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ func Run() {
1313
// TODO use command factories instead of global command variables
1414
// TODO add describe command that shows template metadata information
1515
// TODO add create command that creates a minimal template template
16-
// TODO rename template-tag to template-tag
1716

1817
Template := &cli.Command{
1918
Use: "template",

pkg/cmd/save.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616

1717
// Save contains the cli-command for saving templates to template registry.
1818
var Save = &cli.Command{
19-
// TODO rename template-tag to template-tag
2019
Use: "save <template-path> <template-tag>",
2120
Short: "Save a project template to local template registry",
2221
Run: func(c *cli.Command, args []string) {
@@ -53,7 +52,6 @@ var Save = &cli.Command{
5352
}
5453

5554
if _, err := exec.Cmd("cp", "-r", tmplDir, targetDir); err != nil {
56-
// TODO create exec package
5755
exit.Error(err)
5856
}
5957

pkg/cmd/use.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package cmd
33
import (
44
"fmt"
55
"os"
6+
"path/filepath"
67

78
cli "github.com/spf13/cobra"
89

@@ -36,7 +37,11 @@ var Use = &cli.Command{
3637

3738
MustValidateTemplateDir()
3839

39-
tmplName, targetDir := args[0], args[1]
40+
tmplName := args[0]
41+
targetDir, err := filepath.Abs(args[1])
42+
if err != nil {
43+
exit.Fatal(fmt.Errorf("use: %s", err))
44+
}
4045

4146
if ok, err := TemplateInRegistry(tmplName); err != nil {
4247
exit.Fatal(fmt.Errorf("use: %s", err))

0 commit comments

Comments
 (0)