diff --git a/package.json b/package.json index 35cf259f3a72aed83149f4d9395a579bf112cd97..27ee58e114d69bb4a375a2f0aacdca13492868a6 100644 --- a/package.json +++ b/package.json @@ -126,7 +126,8 @@ "start:server-and-client": "start-test server 3000 client", "test:all": "start-test start:server-and-client 4000 test", "test": "cypress run", - "build": "NODE_ENV=production pubsweet build" + "build": "NODE_ENV=production pubsweet build", + "seedFromDump": "node scripts/seedFromDump.js" }, "jest": { "testEnvironment": "node", diff --git a/scripts/seedFromDump.js b/scripts/seedFromDump.js new file mode 100644 index 0000000000000000000000000000000000000000..f82c898b9c518f64137f381805b416ef6f2247a0 --- /dev/null +++ b/scripts/seedFromDump.js @@ -0,0 +1,10 @@ +const seed = require('./clearAndSeed') + +// // const { execSync } = require('child_process') +const path = require('path') +const { readFileSync } = require('fs') + +const dumpFile = name => + path.join(__dirname, '..', 'cypress', 'dumps', `${name}.sql`) + +seed(readFileSync(dumpFile(process.argv[2]), 'utf-8'))