Better ergonomics for scripts
See original GitHub issueHello!
I’ve been using your project to manage about 150 repos and I’ve been loving it. I’ve had a few pain points, but one is that many of my meta exec statements only apply to a few repositories. For example, I’ll do something like this:
script.sh
if ! [ -a .meta ]; then
BRANCH=$(git remote show origin | grep "HEAD branch" | sed "s/.*: //")
git fetch origin
git checkout $BRANCH
git reset --hard origin/$BRANCH
git clean -fdx
if [ -a package.json ] && ! [ -a .gitignore ]; then
echo 'node_modules' > .gitignore
git add .gitignore
git commit -S -m 'Add .gitignore to ignore node_modules'
git push origin $BRANCH
fi
fi
meta exec "$(< script.sh)"
Here are my pain points:
- I’ll often want to exclude the meta repo, and this seems better suited to a CLI flag than
if ! [ -a .meta ] - I only want to run commands on repos with
package.json, but I get output from all repos – it would be great if repos without any stdout just didn’t show up at all - I personally don’t mind the shell command above, but
meta exec -f script.shmight be more ergonomic
Thanks for your work on this project, I’m loving it!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Ergonomics for Screenwriters - Three Quick Fixes
Three quick ergonomic tips for screenwriters to keep you churning out scripts and pain-free.
Read more >From the Inside Out: Flipping the Script on Modern Ergonomics
Just like there's an app for everything nowadays, for virtually every ergonomic concern, there's a tool. Desks, chairs, cushions, mats, keyboard ...
Read more >Ergonomics for the screenwriter - John August
Ergonomics for the screenwriter · Get a good chair. · Keep your typing surface low. · Consider using an ergonomic keyboard. · Try...
Read more >Ergonomics – Posture – Supervisor's Safety Script
Always Keep Ergonomics in Mind. Maintain Good Posture to Prevent Injury. Ergonomics is the study of employees and their work environment.
Read more >I disagree that Python has better ergonomics than Rust for ...
I disagree that Python has better ergonomics than Rust for scripts like this. For example, IMO python doesn't have anything as nice as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I have meta repos of meta repos, which may or may not make sense for your project, but keep in mind you can slice and dice things different ways and even for different use cases. The same project can exist in many meta repos.
You could make a meta repo called ‘node-projects’ and then run those maintenance type commands from there.
Lately, I’ve been using a meta repo per bounded context, which maps to a deploy to a single helm chart that describes that context and the versions of each of their services.
I’ve built some of this into the plugins, themselves.
meta-loopallows you to pass an options object with atestproperty which accepts a function that returns a boolean. If that boolean is true,meta-execwill run on the current dir. Else, it will skip.https://github.com/mateodelnorte/meta-npm/blob/master/bin/meta-npm-install#L13
@patrickleet has talked about having keys or groups of projects, which could be referred to in commands. I think that’s not a bad idea, but I’d also like to watch out for cluttering up commands as much of the power of these tools is just how simple they are.