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

errors when .sh script run with shim #10

Open
bcoe opened this issue Feb 28, 2016 · 2 comments
Open

errors when .sh script run with shim #10

bcoe opened this issue Feb 28, 2016 · 2 comments

Comments

@bcoe
Copy link
Member

bcoe commented Feb 28, 2016

I finally dug into the problem that @boennemann is seeing here:

istanbuljs/nyc#34

tldr; this script fails when instrumented with spawn-wrap's shim:

https://github.com/semantic-release/semantic-release/blob/caribou/test/registry/start.sh

The logic that is causing the script to fail relates to paths being remapped to point to the spawn-wrap shim:

    for (var i = 0; i < options.envPairs.length; i++) {
      var ep = options.envPairs[i]
      if (ep.match(pathRe)) {
        pathEnv = ep.substr(5)
        var k = ep.substr(0, 5)
        options.envPairs[i] = k + workingDir + colon + pathEnv
      }
    }

One Possible Solution

I managed to instrument semantic-release's integration tests with nyc, by simply ignore the shell script that was causing issues:

    var file = path.basename(options.file, '.exe')
    if (~options.args.indexOf('./start.sh')) {
      console.log(options.args)
      return spawn.call(this, options)
    }

I wonder if we should just have spawn-wrap accept a list of files to ignore? This might be a good way to help people get around edge-cases.

A Better Solution

@isaacs any idea why remapping the /^PATH=/ is causing trouble for this script in particular?

@bcoe
Copy link
Member Author

bcoe commented Apr 11, 2016

@addaleax any thoughts about this old issue that's open on nyc?

@addaleax
Copy link
Member

@bcoe I’d love to help, but the branches mentioned the issue are gone, and it appears quite a bit has happened in the semantic-release since the original report… do you have some kind of working reproduction without it? Or maybe the git SHAs from back then?

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