Skip to content

Commit

Permalink
refactor: renamed the internal variable
Browse files Browse the repository at this point in the history
  • Loading branch information
favoyang committed Nov 16, 2020
1 parent c033738 commit 78ede5b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/cmd-add.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const add = async function(pkgs, options) {
const _add = async function({ pkg, testables, force }) {
// dirty flag
let dirty = false;
// upstream flag
let useUpstream = false;
// is upstream package flag
let isUpstreamPackage = false;
// parse name
let { name, version } = parseName(pkg);
// load manifest
Expand All @@ -60,7 +60,7 @@ const _add = async function({ pkg, testables, force }) {
let pkgInfo = await fetchPackageInfo(name);
if (!pkgInfo && env.upstream) {
pkgInfo = await fetchPackageInfo(name, env.upstreamRegistry);
if (pkgInfo) useUpstream = true;
if (pkgInfo) isUpstreamPackage = true;
}
if (!pkgInfo) {
log.error("404", `package not found: ${name}`);
Expand Down Expand Up @@ -126,7 +126,7 @@ const _add = async function({ pkg, testables, force }) {
}
}
// pkgsInScope
if (!useUpstream) {
if (!isUpstreamPackage) {
const [depsValid, depsInvalid] = await fetchPackageDependencies({
name,
version,
Expand Down Expand Up @@ -175,7 +175,7 @@ const _add = async function({ pkg, testables, force }) {
// Log the existed package
log.notice("manifest", `existed ${name}@${version}`);
}
if (!useUpstream) {
if (!isUpstreamPackage) {
// add to scopedRegistries
if (!manifest.scopedRegistries) {
manifest.scopedRegistries = [];
Expand Down

0 comments on commit 78ede5b

Please sign in to comment.