Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rps gen not working #12

Closed
JGeek00 opened this issue May 4, 2023 · 2 comments
Closed

rps gen not working #12

JGeek00 opened this issue May 4, 2023 · 2 comments
Labels
question Further information is requested

Comments

@JGeek00
Copy link

JGeek00 commented May 4, 2023

I'm trying to run rps gen as it's specified on the documentation but i'm receiving an error.

juan@juan-hp:~/adguard_home_manager$ rps gen
Error! Missing script for: "gen".

I tried running rps run <my command> and it worked so maybe rps gen was working but for some reason it throwed that error.

@JGeek00 JGeek00 changed the title rps gen not woorking rps gen not working May 4, 2023
@gonuit
Copy link
Owner

gonuit commented May 4, 2023

Hi @JGeek00 👋🏻 ,

Do you have a gen script defined in your pubspec.yaml file?

For this to work, you must define the scripts of your choice yourself.
As an example, your pubspec.yaml file might look as follows:

name: my_great_app
description: My great app!
publish_to: "none"

version: 1.0.0+1

scripts:
  run: "flutter run"
  gen: "flutter pub run build_runner build --delete-conflicting-outputs"
  watch: "flutter pub run build_runner watch --delete-conflicting-outputs"   

environment:
  sdk: ">=2.18.0 <3.0.0"

dependencies:
  json_annotation: 4.6.0

dev_dependencies:
  build_runner: ^2.2.1

flutter:
  uses-material-design: true

  assets:
    - assets/images/

Now you can use the rps, rps run, rps gen and rps watch commands 🕵🏻


It is also possible that you have nested the gen script under the run key. I do not recommend it, but it will work, and then calling rps gen is not possible, as it is nested under the run key.

If so, this is a change that should be made:

scripts:
-  run:
-    gen: "flutter pub run build_runner build --delete-conflicting-outputs"
+ gen: "flutter pub run build_runner build --delete-conflicting-outputs"

Let me know if this works for you 🤙🏻

@gonuit gonuit added the question Further information is requested label May 4, 2023
@JGeek00
Copy link
Author

JGeek00 commented May 4, 2023

🤔 I think I misunderstood the instructions. I thought that after adding a custom script you had to run rps gen to "consolidate" the changes. I was running that command without having it declared on the pubspec.yaml. Now I have declared my custom script and everything works fine.

@gonuit gonuit closed this as completed May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants