Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
[cli] Add learn more link about local CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
brentvatne committed Aug 17, 2022
1 parent 68931be commit 4552a4d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/expo-cli/src/utils/migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ import chalk from 'chalk';
import { boolish } from 'getenv';
import { Versions } from 'xdl';

import { learnMore } from '../commands/utils/TerminalLink';
import Log from '../log';

export function warnAboutLocalCLI(projectRoot: string, { localCmd }: { localCmd: string }) {
const { exp } = getConfig(projectRoot, { skipSDKVersionRequirement: true });
const useLocalCLI = boolish('EXPO_USE_LOCAL_CLI', true);
if (Versions.gteSdkVersion(exp, '46.0.0') && useLocalCLI) {
Log.warn(
chalk`\nThis command is being executed with the global Expo CLI.\nTo use the local CLI instead (recommended in SDK 46 and higher), run:\n\u203A {bold npx expo ${localCmd}}\n`
chalk`\nThis command is being executed with the global Expo CLI. ${learnMore(
'https://blog.expo.dev/the-new-expo-cli-f4250d8e3421'
)}\nTo use the local CLI instead (recommended in SDK 46 and higher), run:\n\u203A {bold npx expo ${localCmd}}\n`
);
}
}
Expand Down

0 comments on commit 4552a4d

Please sign in to comment.