Replies: 1 comment
-
|
Spitballing different implementations of this function export default scripts({
"db": variants({
"migrate": sequential([
question('What are you migrating?', { key: '{name}' }),
"prisma migrate dev --name {name}"
])
})
})export default scripts({
"db": variants({
"migrate": question({
message: 'What are you migrating?',
key: '{name}',
run: "prisma migrate dev --name {name}"
})
})
})export default scripts({
"build": sequential([
"prisma generate",
"next build",
"vitest",
booleanQuestion({
message: 'Deploy to production?',
default: false, // default for non-interactive shells
onTrue: "firebase deploy"
})
])
})export default scripts({
"build": sequential([
"prisma generate",
"next build",
"vitest",
optionsQuestion({
message: 'Where to deploy to?',
options: [
{ value: 'production', run: "firebase deploy" },
{ value: 'staging', run: "firebase deploy --only hosting:staging" },
{ value: 'development', run: "firebase deploy --only hosting:development" },
]
})
])
})export default scripts({
"build": sequential([
"prisma generate",
"next build",
"vitest",
optionsQuestion({
message: 'Where to deploy to?',
options: 'production' | 'staging' | 'development',
run: (option) => `firebase deploy --only hosting:${option}`
})
])
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
For example on a database migration script, ask the user the name of the migration then insert it in to the command.
Beta Was this translation helpful? Give feedback.
All reactions