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

Incompatible package globs passed to git checkout after publish #1786

Closed
cspotcode opened this issue Nov 17, 2018 · 2 comments · Fixed by opencomponents/base-templates#368 or JetBrains/ring-ui#515

Comments

@cspotcode
Copy link

Expected Behavior

lerna publish works correctly when using this package glob: packages/!(__template__)

Current Behavior

Lerna tries to run git checkout -- packages/!(__template__)/package.json which fails because git doesn't understand the glob pattern.

https://github.com/lerna/lerna/blob/master/commands/publish/index.js#L411

lerna ERR! Error: Command failed: git checkout -- packages/!(__template__)/package.json
lerna ERR! error: pathspec 'packages/!(__template__)/package.json' did not match any file(s) known to git.

Possible Solution

Use lerna's glob expansions to generate a list of package.json files, then pass them to git checkout

Steps to Reproduce (for bugs)

lerna version patch -m "chore(release): publish [skip ci]" --no-push
lerna publish from-git --yes
lerna.json

{
  "packages": [
    "packages/!(__template__)"
  ],
  "version": "independent",
  "command": {
    "publish": {
      "allowBranch": "master",
      "ignoreChanges": [
        "*.md"
      ]
    },
    "bootstrap": {
      "npmClientArgs": [
        "--no-package-lock"
      ]
    }
  }
}

Context

Your Environment

Executable Version
lerna --version 3.4.3
yarn --version 1.6.0
node --version 8.11

OS is Debian Stretch, via CircleCI's nodejs docker image: circleci/node:8.11.3-stretch

@evocateur
Copy link
Member

Yeah, that's probably better than trying to be fancy with globs. We already know which manifests changed, so the loop can be pretty simple.

@lock
Copy link

lock bot commented Feb 26, 2019

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Feb 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.