2
0

👷 Add daily database cleanup action

Closes #201
This commit is contained in:
Baptiste Arnaud
2023-01-10 11:39:56 +01:00
parent b142dc18eb
commit 4c2eaf9b79
4 changed files with 66 additions and 15 deletions

View File

@@ -2,21 +2,25 @@ import { join } from 'path'
import prompts from 'prompts'
import { isEmpty } from 'utils'
export const promptAndSetEnvironment = async () => {
const response = await prompts({
type: 'select',
name: 'env',
message: 'Pick an environment',
choices: [
{
title: 'Local',
value: 'local',
},
{ title: 'Staging', value: 'staging' },
{ title: 'Production', value: 'production' },
],
initial: 0,
})
export const promptAndSetEnvironment = async (
skipPrompt?: 'local' | 'staging' | 'production'
) => {
const response = skipPrompt
? { env: skipPrompt }
: await prompts({
type: 'select',
name: 'env',
message: 'Pick an environment',
choices: [
{
title: 'Local',
value: 'local',
},
{ title: 'Staging', value: 'staging' },
{ title: 'Production', value: 'production' },
],
initial: 0,
})
if (isEmpty(response.env)) process.exit()