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

point default to named script #208

Open
pvinis opened this issue Oct 23, 2019 · 3 comments
Open

point default to named script #208

pvinis opened this issue Oct 23, 2019 · 3 comments

Comments

@pvinis
Copy link

pvinis commented Oct 23, 2019

This is not really a problem, more of a question.

Can I have something like

module.exports = {
  build: 'yarn some-build-cmd',
  dev: 'yarn some-other-cmd',
  default: // <-- here goes a way to point to `dev`
}

Basically I would like to have a named script, and to point to it as the default.

This would mostly be useful in cases like

{
  ios: {
    alpha: {
      x: 'bla alpha',
      nonX: 'blu alpha',
    },
    beta: {
      x: 'bla beta',
      nonX: 'blu beta',
    },
  },
  default: // some way to point to ios.alpha.nonX
}
@sezna
Copy link
Owner

sezna commented Nov 2, 2019

I don't see any problems with this request. Looks good to me.

@evdhiggins
Copy link

Perhaps I'm missing something, but couldn't this be achieved by directly calling the desired script from default?

e.g.

module.exports = {
  build: 'yarn some-build-cmd',
  dev: 'yarn some-other-cmd',
  default: 'nps build'
}

This will result in nps logging two separate script executions to the console, but I can't imagine that an additional configuration would be more succinct.

I suppose that this wouldn't work very well in a case where you wanted to pass dynamic arguments from the command line to the 2nd named script.

@pvinis
Copy link
Author

pvinis commented Dec 20, 2019

🤔 I guess that makes sense, but it would be nice to have support for args. hmm

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

No branches or pull requests

3 participants