Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Old depreciated Global Expo CLI checks in Doctor command changed #2618

Merged
merged 10 commits into from
Feb 21, 2024
24 changes: 14 additions & 10 deletions src/commands/doctor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,27 +77,32 @@ module.exports = {
: []
const haveGlobalPackages = npmPackages.length > 0 || yarnPackages.length > 0

const expoPath = which("expo")
const expoVersionCmd = "npm list --depth 0 expo 2>&1"
let expoVersion
let expoWorkflow

function expoWorkflowInfo() {
// Define the logic for expoWorkflowInfo
const iosFound = isFile(`${directory}\\ios\\.xcodeproj`)
const androidFound = isFile(`${directory}\\android\\.gradle`)

return iosFound || androidFound
}

try {
expoVersion = (await run(expoVersionCmd))?.match(/expo@(.*)/)?.slice(-1)[0]
expoWorkflow = expoWorkflowInfo() ? "bare" : "managed"
} catch (_) {
expoVersion = "-"
expoWorkflow = "not installed"
if (expoPath) {
try {
expoVersion = (await run(expoVersionCmd))?.match(/expo@(.*)/)?.slice(-1)[0]
expoWorkflow = expoWorkflowInfo() ? "bare" : "managed"
} catch (_) {
expoVersion = "-"
expoWorkflow = "not installed"
}
info("")
info("Warning: Global Expo CLI is deprecated and should be removed.")
info(colors.cyan("Expo"))
table([[column1("expo"), column2(expoVersion), column3(expoWorkflow)]])
}

const expoInfo = [column1("expo"), column2(expoVersion), column3(expoWorkflow)]

info("")
info(colors.cyan(`JavaScript${haveGlobalPackages ? " (and globally-installed packages)" : ""}`))
table([
Expand All @@ -109,7 +114,6 @@ module.exports = {
pnpmInfo,
...pnpmPackages,
bunInfo,
expoInfo,
])

// -=-=-=- ignite -=-=-=-
Expand Down