Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(gatsby-cli): move recipes out of gatsby #23190

Merged
merged 3 commits into from
Apr 17, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
typescript-eslint & optional chaining do not work
  • Loading branch information
wardpeet committed Apr 17, 2020
commit 7c64ba73f5101adec567fb56ad8208e059b6f263
9 changes: 7 additions & 2 deletions packages/gatsby-cli/src/recipes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,28 @@ export async function recipesHandler(recipe: string): Promise<void> {
},
})

// eslint-disable-next-line no-unused-expressions
subprocess.stderr?.on(`data`, data => {
console.log(data.toString())
})
process.on(`exit`, () =>

process.on(`exit`, () => {
subprocess.kill(`SIGTERM`, {
forceKillAfterTimeout: 2000,
})
)
})

// Log server output to a file.
if (process.env.DEBUG) {
const logFile = path.resolve(`./recipe-server.log`)
fs.writeFileSync(logFile, `\n-----\n${new Date().toJSON()}\n`)
const writeStream = fs.createWriteStream(logFile, { flags: `a` })
// eslint-disable-next-line no-unused-expressions
subprocess.stdout?.pipe(writeStream)
}

let started = false
// eslint-disable-next-line no-unused-expressions
subprocess.stdout?.on(`data`, () => {
if (!started) {
const runRecipe = require(`gatsby-recipes/dist/index.js`)
Expand Down