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

Add newRecipe script #186

Merged
merged 5 commits into from
Jul 17, 2020
Merged

Conversation

milesfrain
Copy link
Collaborator

Fixes #181

@milesfrain
Copy link
Collaborator Author

milesfrain commented Jul 17, 2020

Example output (customized helper command reference based on recipe type):

Error and Usage:

./scripts/newRecipe.sh
              
Error: No arguments

Usage:
./scripts/newRecipe.sh <new recipe name> <optional recipe to copy>

Examples:
./scripts/newRecipe.sh MyNewRecipe
./scripts/newRecipe.sh MyNewRecipe HelloHalogenHooks
./scripts/newRecipe.sh MyNewRecipe recipes/HelloHalogenHooks/

Node and Web:

./scripts/newRecipe.sh MyNewRecipe1

Creating new recipe MyNewRecipe1 from HelloLog
+ cp -r recipes/HelloLog recipes/MyNewRecipe1
+ grep -rl HelloLog recipes/MyNewRecipe1
+ xargs sed -i s/HelloLog/MyNewRecipe1/g
+ set +x
--- Some helpful development commands for this recipe: ---

* Watch for changes and rebuild and re-run in node.js:
    make MyNewRecipe1-node-watch

* Launch in web browser (will refresh upon rebuild):
    make MyNewRecipe1-web

* Watch for changes and rebuild (only necessary if editing without purs-ide):
    make MyNewRecipe1-build-watch

--------- Common to all recipe types: ---------

* Manual rebuild:
    make MyNewRecipe1-build

* Regenerate recipe table (run this after editing recipes/MyNewRecipe1/README.md):
    make readme

Web Only:

./scripts/newRecipe.sh MyNewRecipe2 HelloHalogenHooks
...
--- Some helpful development commands for this recipe: ---

* Launch in web browser (will refresh upon rebuild):
    make MyNewRecipe2-web

* Watch for changes and rebuild (only necessary if editing without purs-ide):
    make MyNewRecipe2-build-watch

--------- Common to all recipe types: ---------

* Manual rebuild:
    make MyNewRecipe2-build

* Regenerate recipe table (run this after editing recipes/MyNewRecipe2/README.md):
    make readme

Node CLI:

./scripts/newRecipe.sh MyNewRecipe3 recipes/DiceCLI 
--- Some helpful development commands for this recipe: ---
...
* Re-run in node.js:
    make MyNewRecipe3-node

--------- Common to all recipe types: ---------
...

@milesfrain milesfrain mentioned this pull request Jul 17, 2020
grep -rl $orig recipes/$1 | xargs sed -i "s/$orig/$1/g"

# Build recipe
make $1-build
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we want to build the recipe immediately after copying it... If the base includes additional dependencies that one does not want, it might affect the IDE's cache (i.e. what it considers to be included in the project when doing autocomplete and whatnot).
Other than that, this looks really good!

@milesfrain milesfrain merged commit 0c0b5ed into JordanMartinez:master Jul 17, 2020
@milesfrain milesfrain deleted the new-recipe-script branch July 17, 2020 16:38
This was referenced Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace contributing Goal 2 with a helper script
2 participants