nodesource / ncm-ci

NCM for CICD systems
https://nodesource.com/products/certified-modules
MIT License
8 stars 2 forks source link

Run in root if current working directory is a subdirectory of a Node.js project #18

Closed bnb closed 6 years ago

bnb commented 6 years ago

@cxreg mentioned that with both npm and git if you run a command – like npm install in a subdirectory of the current project, it will install at the root of the current project.

This would be a useful feature for ncm-ci to match expectations set by other CLI tools 😁

juliangruber commented 6 years ago

I've never done this personally, is this frequent in other peoples' workflows?

pmuellr commented 6 years ago

I've never used npm in a sub-dir, but frequently use git in a sub-dir.

With this being a CI tool, that you'd probably stick in a bash script or such, it strikes me that having an option to specify the directory you want checked might be appropriate.

I don't think there's much harm in adding such functionality though, other than the cost of a few more exists('package.json') calls, if it didn't find one in the cwd.

juliangruber commented 6 years ago

Is in CI your CWD not always your project's root? I'm going to close this for now, but let's add this functionality to the future CLI tool