hrk 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +63 -29
- data/lib/hrk/execute/help.rb +8 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c55c5d03bcb00380ffcff94955234658934ee118
|
4
|
+
data.tar.gz: 72e2a53ee349c5dbaece355c70b89085dc72827f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c5dfad9f5057ce40bda69d34dca06ccac6d068be94e607efabb66d29e08e7f838e72e5e58128e66d732b7e2ea31d52fda5f12e3dbb6f89cec7bb7e0626c4c1f
|
7
|
+
data.tar.gz: 57f0447db88c4739215ed04c94f046e12db6da9983d2c048d34c3c0576c9c10076af74960824e4eb6d156d48688e87f46dd0a3f840f7aa62adcf0393859e1825
|
data/README.md
CHANGED
@@ -21,66 +21,100 @@ $ bundle install
|
|
21
21
|
|
22
22
|
And enjoy the hrk command awesome power:
|
23
23
|
```
|
24
|
-
$ hrk your-heroku-remote-name logs
|
24
|
+
$ hrk your-heroku-remote-name: logs && hrk : run console
|
25
25
|
```
|
26
26
|
|
27
27
|
|
28
28
|
## What does it do?
|
29
29
|
|
30
|
-
It's a command that calls the heroku toolbelt command for you,
|
31
|
-
|
30
|
+
It's a command that calls the heroku toolbelt command for you, remembers the
|
31
|
+
name of the previous remote so you don't have to re-type it again and again
|
32
|
+
and again each time you want to chain heroku commands.
|
32
33
|
|
33
34
|
For example, let's say I've got an heroku app that's called:
|
34
35
|
|
35
|
-
> this-really-long-
|
36
|
+
> this-really-long-remote-name
|
36
37
|
|
37
38
|
Well, I type my heroku commands like:
|
38
39
|
|
39
|
-
```
|
40
|
-
$ heroku run rake do:stuff
|
40
|
+
```bash
|
41
|
+
$ heroku run rake do:stuff -r this-really-long-remote-name
|
41
42
|
```
|
42
43
|
|
43
44
|
And it's easy.
|
44
45
|
|
45
|
-
Yep, but now I
|
46
|
-
other heroku repositories that I aptly call:
|
46
|
+
Yep, but now I want to chain my commands:
|
47
47
|
|
48
|
-
```
|
49
|
-
this-really-long-
|
50
|
-
this-really-long-
|
48
|
+
```bash
|
49
|
+
$ heroku run rake do:something:else -r this-really-long-remote-name && \
|
50
|
+
heroku run rake other:thing -r this-really-long-remote-name && \
|
51
|
+
heroku run rake yet:another:task -r this-really-long-remote-name
|
51
52
|
```
|
52
53
|
|
53
|
-
|
54
|
+
And sometimes you mistype, and the chain breaks in the middle, and it sucks.
|
54
55
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
$
|
56
|
+
**Wait, I can do something like that**
|
57
|
+
|
58
|
+
```bash
|
59
|
+
$ export REMOTE_NAME=this-really-long-remote-name && \
|
60
|
+
heroku run rake do:something:else -r $REMOTE_NAME && \
|
61
|
+
heroku run rake other:thing -r $REMOTE_NAME && \
|
62
|
+
heroku run rake yet:another:task -r $REMOTE_NAME
|
59
63
|
```
|
60
64
|
|
61
|
-
|
65
|
+
Yup. Now It doesn't look really that better now does it?
|
62
66
|
|
63
67
|
**Hrk to the rescue!**
|
64
68
|
|
65
|
-
|
66
|
-
more sensible way than just your heroku app names, for example:
|
69
|
+
Hrk remembers the previous remote you've used. So you can do:
|
67
70
|
|
71
|
+
```bash
|
72
|
+
$ hrk this-relly-long-remote-name: run rake do:some:work && \
|
73
|
+
hrk : run rake arrange:stuff && \
|
74
|
+
hrk : run rake test:some:thingy
|
68
75
|
```
|
69
|
-
prod => this-really-long-app-name
|
70
|
-
staging => this-really-long-app-name-that-is-used-as-a-demo
|
71
|
-
test => this-really-long-app-name-draft
|
72
|
-
```
|
73
76
|
|
74
|
-
|
75
|
-
|
77
|
+
Isn't it more fun?
|
78
|
+
|
79
|
+
## Wait, what happens when...
|
80
|
+
|
81
|
+
**...I chain hrk commands with other bash commands?**
|
76
82
|
|
83
|
+
No worry there, the previous remote will be remembered as long as you don't
|
84
|
+
close your terminal.
|
85
|
+
|
86
|
+
```bash
|
87
|
+
$ git push demo && \
|
88
|
+
hrk demo: run rake set-this-once && \ # happens on demo
|
89
|
+
git push -f demo HEAD^ && \
|
90
|
+
hrk : restart # also on demo
|
77
91
|
```
|
78
|
-
|
79
|
-
|
80
|
-
|
92
|
+
|
93
|
+
**...I chain hrk commands on concurrent terminals for different remotes?**
|
94
|
+
|
95
|
+
No worry either, both terminals have their own memory and shouldn't overlap.
|
96
|
+
Then:
|
97
|
+
|
98
|
+
```bash
|
99
|
+
# on terminal 1
|
100
|
+
$ hrk demo: run rake db:migrate && \ # happens on demo
|
101
|
+
hrk : restart # still on demo
|
102
|
+
# on terminal 2
|
103
|
+
$ hrk prod: run rake db:migrate && \ # happens on prod
|
104
|
+
hrk : restart # still on prod
|
81
105
|
```
|
82
106
|
|
83
|
-
|
107
|
+
**...I set another remote after completing a bunch of commands?**
|
108
|
+
|
109
|
+
The last remote set is the one used by default for subsequent commands. So:
|
110
|
+
|
111
|
+
```bash
|
112
|
+
$ hrk demo: run rake db:migrate && \ # happens on demo
|
113
|
+
hrk : restart && \ # also on demo
|
114
|
+
hrk prod: maintenance:on && \ # happens on prod
|
115
|
+
hrk : run rake db:migrate && \ # also on prod
|
116
|
+
hrk : maintenance:off # still on prod
|
117
|
+
```
|
84
118
|
|
85
119
|
## Do I still need the heroku toolbelt?
|
86
120
|
|
data/lib/hrk/execute/help.rb
CHANGED
@@ -16,8 +16,14 @@ module Hrk
|
|
16
16
|
def display
|
17
17
|
puts <<-eos
|
18
18
|
Usage:
|
19
|
-
hrk remote: command...
|
20
|
-
hrk [h | help | -h | --help]
|
19
|
+
hrk [remote]: command...
|
20
|
+
hrk [h | help | -h | --help]
|
21
|
+
|
22
|
+
hrk remembers the last remote you've used to send a command on this terminal,
|
23
|
+
and use it by default when you omit the optional [remote] argument.
|
24
|
+
|
25
|
+
The command is whatever you would give heroku, except (obviously) for the
|
26
|
+
-r or -a argument.
|
21
27
|
|
22
28
|
Options:
|
23
29
|
-h --help Display this screen.
|