From 4d5cf7c16dad8f65cb4aaccf686d5b642cfd65c3 Mon Sep 17 00:00:00 2001 From: Shane Earley Date: Wed, 25 Oct 2023 12:38:22 -0400 Subject: [PATCH] Fix users db cleanup (skip deploy) --- scripts/root/dev.ts | 9 ++++++++- services/users/scripts/db.ts | 9 +-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/root/dev.ts b/scripts/root/dev.ts index 9b80a18fc..1a85e80d6 100644 --- a/scripts/root/dev.ts +++ b/scripts/root/dev.ts @@ -1,7 +1,7 @@ import { ethers } from 'ethers' import { loadCredentials, getSecret } from '@casimir/aws' import { ETHEREUM_CONTRACTS, ETHEREUM_NETWORK_NAME, ETHEREUM_RPC_URL } from '@casimir/env' -import { run } from '@casimir/shell' +import { run, runSync } from '@casimir/shell' /** * Run an integrated development environment @@ -135,4 +135,11 @@ void async function () { } else { run(`npm run dev --workspace @casimir/${app}`) } + + if (process.env.MOCK_SERVICES === 'true') { + process.on('SIGINT', () => { + runSync('npm run clean --workspace @casimir/users') + process.exit() + }) + } }() diff --git a/services/users/scripts/db.ts b/services/users/scripts/db.ts index d311bf60b..30d500a04 100644 --- a/services/users/scripts/db.ts +++ b/services/users/scripts/db.ts @@ -1,6 +1,6 @@ import fs from 'fs' import os from 'os' -import { run, runSync } from '@casimir/shell' +import { run } from '@casimir/shell' import { getSecret, loadCredentials } from '@casimir/aws' import { JsonSchema, Schema, accountSchema, nonceSchema, operatorSchema, userSchema, userAccountSchema } from '@casimir/data' @@ -65,11 +65,4 @@ void async function () { } await run(`atlas schema apply --url "postgres://postgres:password@localhost:5432/users?sslmode=disable" --to "file://${sqlDir}/schema.sql" --dev-url "docker://postgres/15" --auto-approve`) - - if (process.env.MOCK_SERVICES === 'true') { - process.on('SIGINT', () => { - runSync('npm run clean --workspace @casimir/users') - process.exit() - }) - } }() \ No newline at end of file