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

Allow npm projects without name and versions #546

Merged
merged 2 commits into from
Aug 15, 2021

Conversation

yahavi
Copy link
Member

@yahavi yahavi commented Aug 9, 2021

  • All tests passed. If this feature is not already covered by the tests, I added new tests.

package.json files are allowed to be without name and version nodes. Currently, the code throws NPE in such cases.
If name is missing, use the directory name as the project name.
If only version is missing, use the name without the version as the project name.
Otherwise, use : as the project name.

@yahavi yahavi requested review from eyalbe4 and talarian1 August 9, 2021 16:43
@yahavi yahavi self-assigned this Aug 9, 2021
* @param workingDir - The package.json directory
* @return <name>:<version>, <name> or <directory-name>
*/
static String getProjectName(JsonNode npmList, Path workingDir) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static String --> private static String

Copy link
Member Author

@yahavi yahavi Aug 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this function is in use in the test

@yahavi yahavi merged commit 736b505 into jfrog:master Aug 15, 2021
@yahavi yahavi deleted the npm-nameless branch August 15, 2021 13:23
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

Successfully merging this pull request may close these issues.

2 participants