Run Pubspec Script (RPS)
Define and use scripts from your pubspec.yaml file.
Install this package.
dart pub global activate rps
Define script inside the pubspec.yaml
name: my_great_app version: 1.0.0 scripts: # run is a default script. To use it, simply type # in the command line: "rps" - that's all! run: "flutter run -t lib/main_development.dart --flavor development" # you can define more commands like this: "rps gen" gen: "flutter pub run build_runner watch --delete-conflicting-outputs" # and even nest them! build: android: # rps build android apk apk: "flutter build --release apk --flavor production" # rps build android appbundle appbundle: "flutter build --release appbundle --flavor production" # and so on... # the rest of your pubspec file... dependencies: path: ^1.7.0
Use your custom command.
gencommand that we defined in the previous step:
flutter pub run build_runner watch --delete-conflicting-outputs
Safe a time and become a power user! ?
Less time typing long commands more time watching funny cats. ?
You can use commands that will be executed before or after some command. Have a look at these scripts in the
scripts: test: before-echo: echo "before-test" echo: echo "test" after-echo: echo "after-test"
rps test echo command produces following output:
> test before-echo $ echo "before-test" before-test > test echo $ echo "test" test > test after-echo $ echo "after-test" after-test
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…
- Further hooks improvements.
Hey you! This package is still in development (bugs may occur ??).