Skip to content

Commit 52a1a0a

Browse files
committed
Update readme
1 parent 05aaaef commit 52a1a0a

File tree

3 files changed

+83
-79
lines changed

3 files changed

+83
-79
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 0.7.0-dev.4
1+
## 0.7.0-dev.6
22

33
### BREAKING CHANGES
44

README.md

Lines changed: 81 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,41 @@
11
# Run Pubspec Script (RPS)
22

3-
Define and use scripts from your _pubspec.yaml_ file.
3+
RPS is a dart script manager that allows you to define and use scripts from the _pubspec.yaml_ file.
44

5-
## Getting started
65

7-
1. Install this package.
6+
## Features
7+
<!-- no toc -->
8+
- [🪆 Nesting](#nesting)
9+
- [🔗 References](#references)
10+
- [🪝 Hooks](#hooks)
11+
- [💻 Platform specific scripts](#platform-specific-scripts)
812

9-
```bash
10-
dart pub global activate rps
11-
```
12-
13-
2. Define script inside the pubspec.yaml
14-
15-
```yaml
16-
name: my_great_app
17-
version: 1.0.0
18-
19-
scripts:
20-
# run is a default script. To use it, simply type
21-
# in the command line: "rps" - that's all!
22-
run: "flutter run -t lib/main_development.dart --flavor development"
23-
# you can define more commands like this: "rps gen"
24-
gen: "flutter pub run build_runner watch --delete-conflicting-outputs"
25-
# and even nest them!
26-
build:
27-
# You can use hooks to! (and even nest them!)
28-
$before: flutter pub get
29-
$after: echo "Build done!"
30-
android:
31-
# rps build android apk
32-
apk: "flutter build --release apk --flavor production"
33-
# rps build android appbundle
34-
appbundle: "flutter build --release appbundle --flavor production"
35-
# and so on...
36-
# 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 🚀
5514

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+
```
5624
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+
```
7030
4. Safe a time and become a power user! 😈
31+
32+
Less time typing long commands more time watching funny cats. 🐈
7133

72-
Less time typing long commands more time watching funny cats. 🐈
34+
# Features
7335

74-
## Nesting
36+
## 🪆 Nesting
7537

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.
7739

7840
```yaml
7941
scripts:
@@ -93,7 +55,7 @@ Use with ease 😏
9355
rps build android apk
9456
```
9557
96-
## References
58+
## 🔗 References
9759
9860
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! ⛑
9961
@@ -111,19 +73,20 @@ scripts:
11173

11274
References can also be used with `$before` and `$after` hooks.
11375

114-
## Hooks
76+
## 🪝 Hooks
77+
11578

11679
To enable hooks define the `$before` and/or `$after` keys for your script command.
11780

11881
```yaml
11982
scripts:
120-
hooks:
83+
hello:
12184
$before: echo "hello before" # executed before the $script
12285
$script: echo "hello script"
12386
$after: echo "hello after" # executed after $script
12487
```
12588
126-
Execute by calling the `rps hooks`.
89+
All hooks will be executed in the specified order when calling the `rps hello` command.
12790

12891
You can also combine multiple scripts using references!
12992

@@ -140,7 +103,7 @@ scripts:
140103
$script: flutter build apk
141104
```
142105

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!
144107

145108
```yaml
146109
# Order when executing: "rps generator build"
@@ -156,7 +119,7 @@ scripts:
156119

157120
You don't have to worry about cyclic references 🔄, RPS will keep track of them and notify you in case of a problem 😏.
158121

159-
## Platform specific scripts
122+
## 💻 Platform specific scripts
160123

161124
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! 🛠
162125

@@ -182,18 +145,59 @@ You are on MacOs!
182145
183146
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?
184147
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"
160+
# and even nest them!
161+
build:
162+
# You can use hooks to! (and even nest them!)
163+
$before: flutter pub get
164+
$after: echo "Build done!"
165+
android:
166+
# rps build android apk
167+
apk:
168+
$before: echo "Building android apk..."
169+
$script: "flutter build --release apk --flavor production"
170+
# rps build android appbundle
171+
appbundle: "flutter build --release appbundle --flavor production"
172+
# and so on...
173+
# 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+
185193
---
186194

187-
## Motivation
195+
## 📈 Motivation
188196

189197
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...
190198

191199
![stonks](./stonks.jpg)
192200

193-
## Soon
194-
195-
- Further hooks improvements.
196-
197201
---
198202

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 🐛😏).

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: rps
22
description: rps (Run Pubspec Script) allows you to define and run scripts from pubspec.yaml.
3-
version: 0.7.0-dev.4
3+
version: 0.7.0-dev.6
44
repository: https://github.com/gonuit/rps
55
homepage: https://github.com/gonuit/rps
66
issue_tracker: https://github.com/gonuit/rps/issues

0 commit comments

Comments
 (0)