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

Remove metaLoop execution in parent repo #16

Closed
sramam opened this issue Aug 30, 2019 · 6 comments
Closed

Remove metaLoop execution in parent repo #16

sramam opened this issue Aug 30, 2019 · 6 comments

Comments

@sramam
Copy link

sramam commented Aug 30, 2019

I'm trying to use meta to manage a bunch of child repos with meta - very convenient idea. Thank you.

Let's say each of these child repos has a npm run-script for linting: npm run lint.
meta npm run lint fails in the parent directory, because by default, meta-loop seems to want to run the command in the parent repo.

Strikes me that the meta repo should be managed independent of the child repos.

Is there a chance this line can be removed?

@mateodelnorte
Copy link
Owner

mateodelnorte commented Aug 30, 2019 via email

@mateodelnorte
Copy link
Owner

mateodelnorte commented Aug 30, 2019 via email

@sramam
Copy link
Author

sramam commented Aug 30, 2019

hmm - the only way I was able to get this to work was to add a dummy run-script in parent: package.json. Howeve, this repo reproduces the problem I am encounering

@mateodelnorte
Copy link
Owner

this is not a bug. you only need to type the basename of the directory you're excluding. notice how this command does not print pwd for the parent meta repo:

$ meta exec pwd --exclude meta

find-file-recursively-up:
/Users/matt/development/meta/plugins/find-file-recursively-up
find-file-recursively-up ✓

get-meta-file:
/Users/matt/development/meta/plugins/get-meta-file
get-meta-file ✓

loop:
/Users/matt/development/meta/plugins/loop
loop ✓

meta-exec:
/Users/matt/development/meta/plugins/meta-exec
meta-exec ✓

meta-gh:
/Users/matt/development/meta/plugins/meta-gh
meta-gh ✓

meta-git:
/Users/matt/development/meta/plugins/meta-git
meta-git ✓

meta-init:
/Users/matt/development/meta/plugins/meta-init
meta-init ✓

meta-loop:
/Users/matt/development/meta/plugins/meta-loop
meta-loop ✓

meta-npm:
/Users/matt/development/meta/plugins/meta-npm
meta-npm ✓

meta-project:
/Users/matt/development/meta/plugins/meta-project
meta-project ✓

meta-yarn:
/Users/matt/development/meta/plugins/meta-yarn
meta-yarn ✓

symlink-meta-dependencies:
/Users/matt/development/meta/plugins/symlink-meta-dependencies
symlink-meta-dependencies ✓

@mateodelnorte
Copy link
Owner

See more info here https://github.com/mateodelnorte/loop#loop

@sramam
Copy link
Author

sramam commented Aug 30, 2019

Interesting. I was able to make exec work too. It was the meta-npm that caused me trouble, So I tried exec'ing the npm command to the same effect:

meta exec "npm run lint" --exclude /private/tmp/trial/meta-bug-16

/private/tmp/trial/meta-bug-16:
npm ERR! missing script: lint

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sramam/.npm/_logs/2019-08-30T16_43_06_131Z-debug.log
/private/tmp/trial/meta-bug-16: command 'npm run lint' exited with error: Error: Command failed: npm run lint

repos/node-starter:

> @tufan/node-starter@1.0.0 lint /private/tmp/trial/meta-bug-16/repos/node-starter
> tslint -c tslint.json --project ./tsconfig.json --format stylish

no-use-before-declare is deprecated. Since TypeScript 2.9. Please use the built-in compiler checks instead.
no-unused-variable is deprecated. Since TypeScript 2.9. Please use the built-in compiler checks instead.
repos/node-starter ✓

meta exec pwd --exclude /private/tmp/trial/meta-bug-16

/private/tmp/trial/meta-bug-16:
/tmp/trial/meta-bug-16
/private/tmp/trial/meta-bug-16 ✓

repos/node-starter:
/private/tmp/trial/meta-bug-16/repos/node-starter
repos/node-starter ✓
 sramam  tmp  trial  meta-bug-16  master

Looking through the meta-npm module, it looked like the loop options were being stripped and it was upto the meta-loop to pick them up and process them again. I just took a cursory look - so very likely I missed something.

Creating a dummy run-script in the mete repo works-around the issue - slightly unwieldy, but I'l live it.

meta is a really cool take on multi/mono repos. Thanks for creating it.

I'll leave it alone at this point unless you reopen the issue.

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

No branches or pull requests

2 participants