Skip to content

Commit

Permalink
Always try to semver.clean(), fixes yarnpkg#3661 (yarnpkg#3702)
Browse files Browse the repository at this point in the history
  • Loading branch information
mchro authored and arcanis committed Jun 23, 2017
1 parent 1e0575c commit c63e015
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"version": "v1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "",
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["No license field"]
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ export default class Config {

/**
* try get the manifest file by looking
* 1. mainfest file in cache
* 1. manifest file in cache
* 2. manifest file in registry
*/
async maybeReadManifest(dir: string, priorityRegistry?: RegistryNames, isRoot?: boolean = false): Promise<?Manifest> {
Expand Down
2 changes: 1 addition & 1 deletion src/util/normalize-manifest/fix.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default (async function(
const files = await fs.readdir(moduleLoc);

// clean info.version
if (typeof info.version === 'string' && !semver.valid(info.version)) {
if (typeof info.version === 'string') {
info.version = semver.clean(info.version, looseSemver) || info.version;
}

Expand Down

0 comments on commit c63e015

Please sign in to comment.