Skip to content

Commit

Permalink
feat: scaffold command checks for python existence, fixes #19
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddentao committed Sep 21, 2023
1 parent 05a499a commit 28c5ee2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/commands/scaffold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,18 @@ export const command = () =>
info('Checking Node.js version...')
const nodeVersion = (await $({ quiet: true })`node --version`).stdout.trim()
if (semver.lt(nodeVersion, 'v20.0.0')) {
error(`Node.js version is too old. Please upgrade to at least v20 to run the scaffolding project.`)
error(`Node.js version is too old. Please upgrade to at least v20 to run the scaffolding command.`)
}

info('Checking for Python...')
try {
await $({ quiet: true })`python --version`
} catch (err) {
try {
await $({ quiet: true })`python3 --version`
} catch (err2) {
error(`Python is not installed. Please goto https://www.python.org/downloads/ for instructions.\n${err2}`)
}
}

info('Ensuring folder is empty...')
Expand Down

0 comments on commit 28c5ee2

Please sign in to comment.