Skip to content

Commit a947a88

Browse files
committed
fix syntax error in generate-local
1 parent dc81de2 commit a947a88

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

generate-local.js

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,36 @@
11
import chalk from 'chalk'
22
import commandExists from 'command-exists'
33
import execa from 'execa'
4-
import { copyFileSync, ensureDirSync, ensureFileSync, existsSync, mkdirpSync, removeSync } from 'fs-extra'
4+
import { copyFileSync, ensureFileSync, existsSync, removeSync } from 'fs-extra'
55
import minimist from 'minimist'
66
import path from 'path'
77
import 'hard-rejection/register'
88

9-
const docsPath = '../ember-api-docs-data';
9+
const docsPath = '../ember-api-docs-data'
1010

1111
const argv = minimist(process.argv.slice(2))
1212

13-
const { project, version, install, build } = argv
13+
const { project, version, install } = argv
1414

1515
const exit = function exit() {
1616
console.log(...arguments)
1717
process.exit(1)
1818
}
1919

20-
const runCmd = async (cmd, path, args = []) => {
20+
async function runCmd (cmd, path, args = []) {
2121
console.log(chalk.underline(`Running '${chalk.green(cmd)}' in ${path}`))
2222
const executedCmd = await execa(cmd, args, { cwd: path, shell: true, stdio: 'inherit' })
2323

24-
if (executedCmd.failed) {
25-
console.error(executedCmd.stdout)
26-
console.error(executedCmd.stderr)
27-
process.exit(1)
28-
29-
}
30-
console.log(executedCmd.stdout + '\n')
31-
} catch (error) {
32-
console.log(error)
24+
if (executedCmd.failed) {
25+
console.error(executedCmd.stdout)
26+
console.error(executedCmd.stderr)
3327
process.exit(1)
3428
}
29+
30+
console.log(executedCmd.stdout + '\n')
3531
}
36-
;(async () => {
32+
33+
(async () => {
3734
if (!project || !version) {
3835
exit(
3936
chalk.red('Both project and version args are required.\n'),
@@ -79,7 +76,7 @@ const runCmd = async (cmd, path, args = []) => {
7976

8077
let destination = `${docsPath}/s3-docs/v${version}/${project}-docs.json`
8178
ensureFileSync(destination)
82-
const projYuiDocFile = destination;
79+
const projYuiDocFile = destination
8380
removeSync(projYuiDocFile)
8481
removeSync(`${docsPath}/json-docs/${project}/${version}`)
8582

0 commit comments

Comments
 (0)