@@ -4,7 +4,6 @@ import execa from 'execa'
4
4
import { copyFileSync , ensureFileSync , existsSync , removeSync } from 'fs-extra'
5
5
import minimist from 'minimist'
6
6
import path from 'path'
7
- import 'hard-rejection/register'
8
7
9
8
const docsPath = '../ember-api-docs-data'
10
9
@@ -17,7 +16,7 @@ const exit = function exit() {
17
16
process . exit ( 1 )
18
17
}
19
18
20
- async function runCmd ( cmd , path , args = [ ] ) {
19
+ async function runCmd ( cmd , path , args = [ ] ) {
21
20
console . log ( chalk . underline ( `Running '${ chalk . green ( cmd ) } ' in ${ path } ` ) )
22
21
const executedCmd = await execa ( cmd , args , { cwd : path , shell : true , stdio : 'inherit' } )
23
22
@@ -30,11 +29,11 @@ async function runCmd (cmd, path, args = []) {
30
29
console . log ( executedCmd . stdout + '\n' )
31
30
}
32
31
33
- ( async ( ) => {
32
+ ; ( async ( ) => {
34
33
if ( ! project || ! version ) {
35
34
exit (
36
35
chalk . red ( 'Both project and version args are required.\n' ) ,
37
- chalk . yellow ( ' e.g., yarn gen --project ember --version 3.10.1' )
36
+ chalk . yellow ( ' e.g., yarn gen --project ember --version 3.10.1' ) ,
38
37
)
39
38
}
40
39
@@ -66,13 +65,15 @@ async function runCmd (cmd, path, args = []) {
66
65
await runCmd ( 'corepack' , projDirPath , [ 'pnpm' , 'install' ] )
67
66
}
68
67
69
-
70
68
if ( install ) {
71
69
await runCmd ( project === 'ember' ? 'yarn' : 'pnpm install' , projDirPath )
72
70
console . log ( '\n\n' )
73
71
}
74
72
75
- await runCmd ( project === 'ember' ? 'volta run yarn docs' : 'corepack pnpm run build:docs' , projDirPath )
73
+ await runCmd (
74
+ project === 'ember' ? 'volta run yarn docs' : 'corepack pnpm run build:docs' ,
75
+ projDirPath ,
76
+ )
76
77
77
78
let destination = `${ docsPath } /s3-docs/v${ version } /${ project } -docs.json`
78
79
ensureFileSync ( destination )
@@ -82,7 +83,7 @@ async function runCmd (cmd, path, args = []) {
82
83
83
84
const yuiDocFile = path . join (
84
85
projDirPath ,
85
- project === 'ember' ? 'docs/data.json' : 'packages/-ember-data/dist/docs/data.json'
86
+ project === 'ember' ? 'docs/data.json' : 'packages/-ember-data/dist/docs/data.json' ,
86
87
)
87
88
copyFileSync ( yuiDocFile , projYuiDocFile )
88
89
}
@@ -102,6 +103,6 @@ async function runCmd (cmd, path, args = []) {
102
103
project ,
103
104
'--version' ,
104
105
version ,
105
- '--no-sync'
106
+ '--no-sync' ,
106
107
] ) . stdout . pipe ( process . stdout )
107
108
} ) ( )
0 commit comments