Skip to content

Commit

Permalink
Remove auto forced sync (#3)
Browse files Browse the repository at this point in the history
* add check for -f flag

* '.includes' instead of '.indexOf'
  • Loading branch information
IanR01 authored Mar 21, 2024
1 parent 1939f26 commit 0a88537
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion reset.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ const fs = require('fs').promises;
const constants = require('fs').constants;
const db = require('./db');

// check for force flag '-f' on commandline to force sync, like: node reset.js -f
const force = process.argv.includes('-f')

async function doReset() {

try {

console.log('Syncing...');

await db.sequelize.sync({force: true})
await db.sequelize.sync({force})

console.log('Adding default data...');
let datafile = process.env.NODE_ENV || 'default';
Expand Down

0 comments on commit 0a88537

Please sign in to comment.