sezna / nps

NPM Package Scripts -- All the benefits of npm scripts without the cost of a bloated package.json and limits of json
MIT License
1.43k stars 93 forks source link

Wrong script getting called #191

Closed pvinis closed 5 years ago

pvinis commented 5 years ago

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?

kentcdodds commented 5 years ago

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

pvinis commented 5 years ago

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.

kentcdodds commented 5 years ago

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?

pvinis commented 5 years ago

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

kentcdodds commented 5 years ago

Yup

kentcdodds commented 5 years ago

I haven't used it in ~1.5 years.

kentcdodds commented 5 years ago

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

florianloechle commented 5 years ago

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.

kentcdodds commented 5 years ago

Hi @schottilol,

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