Skip to content

Commit

Permalink
fix syntax error in generate-local
Browse files Browse the repository at this point in the history
  • Loading branch information
mansona committed Nov 3, 2023
1 parent dc81de2 commit a947a88
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions generate-local.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,36 @@
import chalk from 'chalk'
import commandExists from 'command-exists'
import execa from 'execa'
import { copyFileSync, ensureDirSync, ensureFileSync, existsSync, mkdirpSync, removeSync } from 'fs-extra'
import { copyFileSync, ensureFileSync, existsSync, removeSync } from 'fs-extra'
import minimist from 'minimist'
import path from 'path'
import 'hard-rejection/register'

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

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

const { project, version, install, build } = argv
const { project, version, install } = argv

const exit = function exit() {
console.log(...arguments)
process.exit(1)
}

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

if (executedCmd.failed) {
console.error(executedCmd.stdout)
console.error(executedCmd.stderr)
process.exit(1)

}
console.log(executedCmd.stdout + '\n')
} catch (error) {
console.log(error)
if (executedCmd.failed) {
console.error(executedCmd.stdout)
console.error(executedCmd.stderr)
process.exit(1)
}

console.log(executedCmd.stdout + '\n')
}
;(async () => {

(async () => {
if (!project || !version) {
exit(
chalk.red('Both project and version args are required.\n'),
Expand Down Expand Up @@ -79,7 +76,7 @@ const runCmd = async (cmd, path, args = []) => {

let destination = `${docsPath}/s3-docs/v${version}/${project}-docs.json`
ensureFileSync(destination)
const projYuiDocFile = destination;
const projYuiDocFile = destination
removeSync(projYuiDocFile)
removeSync(`${docsPath}/json-docs/${project}/${version}`)

Expand Down

0 comments on commit a947a88

Please sign in to comment.