Remove prisma dir before copying files.

This commit is contained in:
Mike Cao 2022-06-22 09:32:58 -07:00
parent 60ab144fc2
commit 3c1308890a

View File

@ -1,6 +1,7 @@
require('dotenv').config();
const fse = require('fs-extra');
const path = require('path');
const del = require('del');
function getDatabaseType() {
const type =
@ -25,6 +26,8 @@ console.log(`Database type detected: ${databaseType}`);
const src = path.resolve(__dirname, `../db/${databaseType}`);
const dest = path.resolve(__dirname, '../prisma');
del.sync(dest);
fse.copySync(src, dest);
console.log(`Copied ${src} to ${dest}`);