question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Better ergonomics for scripts

See original GitHub issue

Hello!

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.sh might be more ergonomic

Thanks for your work on this project, I’m loving it!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
patrickleetcommented, Nov 2, 2018

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.

1reaction
mateodelnortecommented, Nov 2, 2018

I’ve built some of this into the plugins, themselves. meta-loop allows you to pass an options object with a test property which accepts a function that returns a boolean. If that boolean is true, meta-exec will 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found