diff --git a/src/cli/commands/upgrade-interactive.js b/src/cli/commands/upgrade-interactive.js index 2c27f3675e..3cc6a10aad 100644 --- a/src/cli/commands/upgrade-interactive.js +++ b/src/cli/commands/upgrade-interactive.js @@ -57,7 +57,7 @@ export async function run( const install = new Install(flags, config, reporter, lockfile); const [deps] = await install.fetchRequestFromCwd(); - const allDeps = (await Promise.all(deps.map(async ({pattern, hint}): Promise => { + const allDeps = await Promise.all(deps.map(async ({pattern, hint}): Promise => { const locked = lockfile.getLocked(pattern); if (!locked) { throw new MessageError(reporter.lang('lockfileOutdated')); @@ -77,7 +77,7 @@ export async function run( } return ({name, current, wanted, latest, hint}); - }))); + })); const isDepOld = ({latest, current}) => latest !== 'exotic' && semver.lt(current, latest); const isDepExpected = ({current, wanted}) => current === wanted; @@ -85,6 +85,11 @@ export async function run( const outdatedDeps = allDeps.filter(isDepOld).sort(orderByExpected); + if (!outdatedDeps.length) { + reporter.success(reporter.lang('allDependenciesUpToDate')); + return; + } + const getNameFromHint = (hint) => hint ? `${hint}Dependencies` : 'dependencies'; const maxLengthArr = {name: 0, current: 0, latest: 0}; diff --git a/src/reporters/lang/en.js b/src/reporters/lang/en.js index e64b840dd0..ed8db68cb4 100644 --- a/src/reporters/lang/en.js +++ b/src/reporters/lang/en.js @@ -76,6 +76,7 @@ const messages = { unexpectedError: 'An unexpected error occurred: $0.', jsonError: 'Error parsing JSON at $0, $1.', noFilePermission: "We don't have permissions to touch the file $0.", + allDependenciesUpToDate: 'All of your dependencies are up to date.', yarnOutdated: "Your current version of Yarn is out of date. The latest version is $0 while you're on $1.", yarnOutdatedInstaller: 'To upgrade, download the latest installer at $0.',