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

post-checkout with no config present #111

Closed
AVVS opened this issue Aug 1, 2017 · 2 comments
Closed

post-checkout with no config present #111

AVVS opened this issue Aug 1, 2017 · 2 comments
Labels

Comments

@AVVS
Copy link
Contributor

AVVS commented Aug 1, 2017

pre-git finds package.json, but it has no "config": { "pre-git" } section as master branch doesn't have pre-git installed yet, nor the config for it.

This causes post-checkout to exit with an error, which causes problems with CI (in my case semaphore)

It would be grand that in case where package.json is found, but no configuration is in there, it would fall back to noop

If you have any other ideas on how to avoid the issue - please let me know, thanks!

vitaly: ~/projects/cappasity-core  (ms-users-v7) $ DEBUG=pre-git git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
  pre-git git prefix env  +0ms
  pre-git running post-checkout +3ms
  pre-git git root folder /Users/vitaly/projects/cappasity-core +14ms
  pre-git set dir to /Users/vitaly/projects/cappasity-core for cwd /Users/vitaly/projects/cappasity-core and git prefix  +1ms
  pre-git found package file /Users/vitaly/projects/cappasity-core/package.json +0ms
  pre-git could not find package in the git root folder +1ms
  pre-git running post-checkout in /Users/vitaly/projects/cappasity-core +2ms
  pre-git running post-checkout at root /Users/vitaly/projects/cappasity-core +0ms
  pre-git cli arguments [ '/Users/vitaly/.nvm/versions/node/v8.1.3/bin/node',
  '/Users/vitaly/projects/cappasity-core/node_modules/pre-git/bin/post-checkout.js',
  '9c13049b9c381c40335e22e59ccb43e0c9eacd1e',
  'bfd85dd23d4a5829c9115f945ac73903ed0e95e2',
  '1' ] +1ms
  pre-git cwd /Users/vitaly/projects/cappasity-core +2ms
  pre-git set dir to /Users/vitaly/projects/cappasity-core for cwd /Users/vitaly/projects/cappasity-core and git prefix  +0ms
  pre-git found package file /Users/vitaly/projects/cappasity-core/package.json +0ms

post-checkout You've failed to pass all the hooks.
post-checkout
post-checkout An Error was thrown from command
Error: Could not find package.json starting from /Users/vitaly/projects/cappasity-core
post-checkout
post-checkout    at verifyValidDirectory (/Users/vitaly/projects/cappasity-core/node_modules/pre-git/src/pre-git.js:35:11)
post-checkout    at findPackage (/Users/vitaly/projects/cappasity-core/node_modules/pre-git/src/pre-git.js:58:3)
post-checkout    at findPackage (/Users/vitaly/projects/cappasity-core/node_modules/pre-git/src/pre-git.js:65:10)
post-checkout    at findPackage (/Users/vitaly/projects/cappasity-core/node_modules/pre-git/src/pre-git.js:65:10)
post-checkout    at findPackage (/Users/vitaly/projects/cappasity-core/node_modules/pre-git/src/pre-git.js:65:10)
post-checkout    at findPackage (/Users/vitaly/projects/cappasity-core/node_modules/pre-git/src/pre-git.js:65:10)
post-checkout    at getPackage (/Users/vitaly/projects/cappasity-core/node_modules/pre-git/src/pre-git.js:69:18)
post-checkout    at getTasks (/Users/vitaly/projects/cappasity-core/node_modules/pre-git/src/pre-git.js:196:13)
post-checkout    at runTasksForLabel (/Users/vitaly/projects/cappasity-core/node_modules/pre-git/src/pre-git.js:306:17)
post-checkout    at runAtRoot (/Users/vitaly/projects/cappasity-core/node_modules/pre-git/src/pre-git.js:333:10)
post-checkout    at getProjRoot.tap.then (/Users/vitaly/projects/cappasity-core/node_modules/pre-git/src/pre-git.js:345:21)
post-checkout    at tryCatcher (/Users/vitaly/projects/cappasity-core/node_modules/bluebird/js/release/util.js:16:23)
post-checkout    at Promise._settlePromiseFromHandler (/Users/vitaly/projects/cappasity-core/node_modules/bluebird/js/release/promise.js:512:31)
post-checkout    at Promise._settlePromise (/Users/vitaly/projects/cappasity-core/node_modules/bluebird/js/release/promise.js:569:18)
post-checkout    at Promise._settlePromise0 (/Users/vitaly/projects/cappasity-core/node_modules/bluebird/js/release/promise.js:614:10)
post-checkout    at Promise._settlePromises (/Users/vitaly/projects/cappasity-core/node_modules/bluebird/js/release/promise.js:693:18)
post-checkout
post-checkout You can skip the git hook by running with -n (--no-verify)
post-checkout
post-checkout But this is not advised as your tests are obviously failing.
@bahmutov bahmutov added the bug label Aug 1, 2017
@bahmutov
Copy link
Owner

bahmutov commented Aug 1, 2017

Version 3.15.2 has been published to NPM. The full release note can be found at pre-git/releases/tag/v3.15.2.

Tip: safely upgrade dependency pre-git in your project using next-update

@AVVS
Copy link
Contributor Author

AVVS commented Aug 1, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants