sezna/nps

Wrong script getting called

Closed this issue · 9 comments

  • nps version: 5.9.3
  • node version: 10.13.0
  • npm version: 6.4.1

Scripts file (or at least the relevant bits):

module.exports = {
    scripts: {
        iosX: 'echo this is iosX',
        ios: 'echo this is ios',
    },
}

The command executed:

nps ios

The output:

nps is executing `iosX` : echo this is iosX
this is iosX

Problem description:
As you can see, when I run nps ios, even though there is a script with name exactly ios, nps is not calling the correct one.

Repro repo: https://github.com/pvinis/nps-bug
Screenshot:
screenshot 2018-12-03 at 16 13 48

Suggested solution:
No idea, but for sure the ios script should be the one getting called.
I have the suspicion that the "smart" calling, like nps i "guesses" what to run, it messing up?

Thanks! This is definitely a bug. Could you dive into this a bit and make a PR to fix it? Thanks!

I have no idea how nps works and I don't have time to get into it. I just wanted to find a better way to manage the scripts.

Gotcha. Well I'm not using nps myself so I don't have time to do it either. Maybe someone else will pick this up?

wat? did you make nps years ago and stopped using it?

Yup

I haven't used it in ~1.5 years.

It's still definitely useful and there are plenty of people using it and loving it. But I've opted for solving my script explosion issues by making toolkits

Hey, this might be a little over the top for a first time contributor, but could I make a pull request for this issue? I've already got a fixed version on my local copy of the repository.

Hi @schottilol,

Feel free to open a PR for it. I'll try to get it reviewed.