Skip to content

Commit b910283

Browse files
authored
Merge pull request #99 from mansona/fix-at-syntax
Fixing issue with npm ci when dependency is defined as tar.gz url
2 parents 37b6e4b + fe9754d commit b910283

File tree

5 files changed

+19
-0
lines changed

5 files changed

+19
-0
lines changed

lib/dependency-checker.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ class EmberCLIDependencyChecker {
119119
version = pkgContent.version || null;
120120
if (isTarGz(versionSpecified)) {
121121
version = pkgContent._from || unknownVersion;
122+
if (version.includes('@')) {
123+
// use the bit after the '@'
124+
version = version.split('@')[1]
125+
}
122126
}
123127
} catch(e) {
124128
// JSON parse error

tests/fixtures/project-npm-tar-gz-at-check/node_modules/example-tar-gz/package.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/fixtures/project-yarn-tar-gz-at-check/node_modules/example-tar-gz/package.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/fixtures/project-yarn-tar-gz-at-check/yarn.lock

Whitespace-only changes.

tests/unit/dependency-checker-package-manager-test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ describe('EmberCLIDependencyChecker', function() {
112112
const project = createProject({ 'example-tar-gz': 'http://ember-cli.com/example-2.0.0.tar.gz' }, { root: 'tests/fixtures/project-'+ packageManagerName + '-tar-gz-check' });
113113
assertNoPackageManagerError(project);
114114
});
115+
116+
it('when the version specified is a url to a tar.gz and a _from is provided in the package.json with the package-name@ prefix and urls match', function() {
117+
const project = createProject({ 'example-tar-gz': 'http://ember-cli.com/example-2.0.0.tar.gz' }, { root: 'tests/fixtures/project-'+ packageManagerName + '-tar-gz-at-check' });
118+
assertNoPackageManagerError(project);
119+
});
115120
});
116121

117122
describe('sibling node_modules/ directory', function() {

0 commit comments

Comments
 (0)