You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# too long command? no problem! define alias using reference syntax!
37
-
bab: $build android appbundle
38
-
# as simple as typing "rps baa"
39
-
baa: $build android apk
40
-
# some commands may vary from platform to platform
41
-
# but that's not a problem
42
-
clear:
43
-
# use the $script key to define platform specific scripts
44
-
$script:
45
-
# define the default script
46
-
$default: rm -rf ./cache
47
-
# And different script for the windows platform.
48
-
$windows: rd /s /q ./cache
49
-
# now "rps clear" will work on any platform!
50
-
51
-
# the rest of your pubspec file...
52
-
dependencies:
53
-
path: ^1.7.0
54
-
```
13
+
## Quick start 🚀
55
14
15
+
1. Install this package.
16
+
```bash
17
+
dart pub global activate rps --version 0.7.0-dev.6
18
+
```
19
+
2. Define scripts inside the pubspec.yaml
20
+
```yaml
21
+
scripts:
22
+
gen: flutter pub run build_runner build --delete-conflicting-outputs
23
+
```
56
24
3. Use your custom command.
57
-
58
-
Like this `gen` command that we defined in the previous step:
59
-
60
-
```bash
61
-
rps gen
62
-
```
63
-
64
-
instead of
65
-
66
-
```bash
67
-
flutter pub run build_runner watch --delete-conflicting-outputs
68
-
```
69
-
25
+
```bash
26
+
rps gen
27
+
# you can also provide additional arguments
28
+
rps gen --verbose
29
+
```
70
30
4. Safe a time and become a power user! 😈
31
+
32
+
Less time typing long commands more time watching funny cats. 🐈
71
33
72
-
Less time typing long commands more time watching funny cats. 🐈
34
+
# Features
73
35
74
-
## Nesting
36
+
## 🪆 Nesting
75
37
76
-
Nest your commands to group them contextually and make them easier to understand 🧪
38
+
Nest your commands to group them contextually and make them easier to understand.
77
39
78
40
```yaml
79
41
scripts:
@@ -93,7 +55,7 @@ Use with ease 😏
93
55
rps build android apk
94
56
```
95
57
96
-
## References
58
+
## 🔗 References
97
59
98
60
Sometimes you may want to create a command alias (e.g. a shorter version of it) or simply pass the execution of a hook to another command. This is where references come to the rescue! ⛑
99
61
@@ -111,19 +73,20 @@ scripts:
111
73
112
74
References can also be used with `$before` and `$after` hooks.
113
75
114
-
## Hooks
76
+
## 🪝 Hooks
77
+
115
78
116
79
To enable hooks define the `$before` and/or `$after` keys for your script command.
117
80
118
81
```yaml
119
82
scripts:
120
-
hooks:
83
+
hello:
121
84
$before: echo "hello before" # executed before the $script
122
85
$script: echo "hello script"
123
86
$after: echo "hello after" # executed after $script
124
87
```
125
88
126
-
Execute by calling the `rps hooks`.
89
+
All hooks will be executed in the specified order when calling the `rps hello` command.
127
90
128
91
You can also combine multiple scripts using references!
129
92
@@ -140,7 +103,7 @@ scripts:
140
103
$script: flutter build apk
141
104
```
142
105
143
-
But wait a minute! The hooks can also be nested!
106
+
You can also nest hooks to provide an easy-to-read workflow for all grouped commands!
144
107
145
108
```yaml
146
109
# Order when executing: "rps generator build"
@@ -156,7 +119,7 @@ scripts:
156
119
157
120
You don't have to worry about cyclic references 🔄, RPS will keep track of them and notify you in case of a problem 😏.
158
121
159
-
## Platform specific scripts
122
+
## 💻 Platform specific scripts
160
123
161
124
Do you work on multiple platforms? Need to use many different commands and always forget which one to use? This is what you've been waiting for! 🛠
162
125
@@ -182,18 +145,59 @@ You are on MacOs!
182
145
183
146
This can be useful for commands like `rm -rf`, which in Windows.... `rd /s /q`, you know what I mean, it can be helpful, right?
184
147
148
+
## 🔎 Overview example
149
+
150
+
```yaml
151
+
name: my_great_app
152
+
version: 1.0.0
153
+
154
+
scripts:
155
+
# run is a default script. To use it, simply type
156
+
# in the command line: "rps" - that's all!
157
+
run: "flutter run -t lib/main_development.dart --flavor development"
158
+
# you can define more commands like this: "rps gen"
159
+
gen: "flutter pub run build_runner watch --delete-conflicting-outputs"
# too long command? no problem! define alias using reference syntax!
174
+
bab: $build android appbundle
175
+
# as simple as typing "rps baa"
176
+
baa: $build android apk
177
+
# some commands may vary from platform to platform
178
+
# but that's not a problem
179
+
clear:
180
+
# use the $script key to define platform specific scripts
181
+
$script:
182
+
# define the default script
183
+
$default: rm -rf ./app/cache
184
+
# And different script for the windows platform.
185
+
$windows: rd /s /q app\cache
186
+
# now "rps clear" will work on any platform!
187
+
188
+
# the rest of your pubspec file...
189
+
dependencies:
190
+
path: ^1.7.0
191
+
```
192
+
185
193
---
186
194
187
-
## Motivation
195
+
## 📈 Motivation
188
196
189
197
I got bored of typing the same long commands over and over again... I even got bored of pressing that boring (and even small on a MacBook) up arrow key to find my previous command in history. So, as befits a programmer, to save time, I spent more time writing this library than searching/writing commands for the last year...
190
198
191
199

192
200
193
-
## Soon
194
-
195
-
- Further hooks improvements.
196
-
197
201
---
198
202
199
-
Hey you! This package is still in development (bugs may occur 🐛😏).
203
+
Hey you! This package is still in development (errors and API changes can still occur 🐛😏).
0 commit comments