Skip to content

Commit 5c36517

Browse files
committed
Merge pull request #28 from spmjs/fix/install
fix(install) 前置 info 查询
2 parents 1ed5c3a + e695bfb commit 5c36517

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/install.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ function* installPackage(id, args, saveDeps) {
8585
log.info('install', color.magenta(pkgId));
8686
debug('start install package %s', pkgId);
8787

88+
var pinfo = yield* info(idObj, args);
89+
pkgId = pinfo.name + '@' + pinfo.version;
90+
8891
// The package has downloaded in dest
8992
// always false when version is not empty
9093
if (existInDest(idObj, args)) return;
@@ -94,9 +97,6 @@ function* installPackage(id, args, saveDeps) {
9497
debug('package %s has been in downloadlist', pkgId);
9598
return;
9699
}
97-
98-
var pinfo = yield* info(idObj, args);
99-
pkgId = pinfo.name + '@' + pinfo.version;
100100
args.downloadlist[pkgId] = pinfo;
101101

102102
// save dependencies to package.json

0 commit comments

Comments
 (0)