Skip to content

Commit 37709b2

Browse files
committed
fix: enable local builds of ember-data to be used
1 parent d25d94a commit 37709b2

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

generate-local.js

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,29 @@ import 'hard-rejection/register'
88

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

11-
const { project, version } = argv
11+
const { project, version, install, build } = argv
1212

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

1818
const runCmd = async (cmd, path) => {
19-
console.log(chalk.underline(`Running '${chalk.green(cmd)}'`))
20-
const executedCmd = await execa(cmd, { cwd: path, shell: true })
19+
console.log(chalk.underline(`Running '${chalk.green(cmd)}' in '${path}'`))
20+
try {
21+
const executedCmd = await execa(`cd ${path} && ${cmd}`, { shell: true })
22+
23+
if (executedCmd.failed) {
24+
console.error(executedCmd.stdout)
25+
console.error(executedCmd.stderr)
26+
process.exit(1)
2127

22-
if (executedCmd.failed) {
23-
console.error(executedCmd.stderr)
28+
}
29+
console.log(executedCmd.stdout + '\n')
30+
} catch (error) {
31+
console.log(error)
2432
process.exit(1)
2533
}
26-
27-
console.log(executedCmd.stdout + '\n')
2834
}
2935
;(async () => {
3036
if (!project || !version) {
@@ -55,11 +61,15 @@ const runCmd = async (cmd, path) => {
5561

5662
let buildDocs = async projDirPath => {
5763
checkIfProjectDirExists(projDirPath)
58-
await runCmd('yarn', projDirPath)
5964

60-
console.log('\n\n')
65+
if (install) {
66+
await runCmd(project === 'ember' ? 'yarn' : 'pnpm install', projDirPath)
67+
console.log('\n\n')
68+
}
6169

62-
await runCmd(project === 'ember' ? 'yarn docs' : 'yarn workspace ember-data docs', projDirPath)
70+
if (build) {
71+
await runCmd(project === 'ember' ? 'yarn docs' : 'pnpm build:docs', projDirPath)
72+
}
6373

6474
const projYuiDocFile = `tmp/s3-docs/v${version}/${project}-docs.json`
6575
removeSync(projYuiDocFile)

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,9 @@
7272
},
7373
"cacheDirectories": [
7474
"tmp"
75-
]
75+
],
76+
"volta": {
77+
"node": "18.15.0",
78+
"yarn": "1.22.19"
79+
}
7680
}

0 commit comments

Comments
 (0)