2018-09-06 15:31:05 +01:00
|
|
|
const fs = require('fs');
|
2018-09-06 15:18:48 +01:00
|
|
|
const path = require('path');
|
2018-09-06 14:58:51 +01:00
|
|
|
|
|
|
|
const env = require('./env');
|
|
|
|
|
2018-09-06 15:18:48 +01:00
|
|
|
const apiPath = path.resolve(__dirname, '../api-server');
|
|
|
|
const clientPath = path.resolve(__dirname, '../client');
|
|
|
|
|
|
|
|
fs.access(`${apiPath}/server/rev-manifest.json`, function(err) {
|
2018-09-06 14:58:51 +01:00
|
|
|
if (err) {
|
|
|
|
console.log('\n\ncreating manifest\n\n');
|
2018-09-06 15:31:05 +01:00
|
|
|
return fs.writeFileSync(`${apiPath}/server/rev-manifest.json`, '{}');
|
2018-05-27 10:57:18 +01:00
|
|
|
}
|
2018-09-06 14:58:51 +01:00
|
|
|
console.log('\n\nrev-manifest present\n\n');
|
|
|
|
return null;
|
|
|
|
});
|
2018-05-27 10:57:18 +01:00
|
|
|
|
2018-09-06 15:18:48 +01:00
|
|
|
fs.access(`${apiPath}/server/resources/pathMigration.json`, err => {
|
2018-09-06 14:58:51 +01:00
|
|
|
if (err) {
|
|
|
|
console.log('\n\ncreating pathMigration\n\n');
|
|
|
|
return fs.writeFileSync(
|
2018-09-06 15:31:05 +01:00
|
|
|
`${apiPath}/server/resources/pathMigration.json`,
|
2018-09-06 14:58:51 +01:00
|
|
|
'{}'
|
|
|
|
);
|
2018-05-27 10:57:18 +01:00
|
|
|
}
|
2018-09-06 14:58:51 +01:00
|
|
|
console.log('\n\npathMigration present\n\n');
|
|
|
|
return null;
|
|
|
|
});
|
|
|
|
|
2018-09-06 15:31:05 +01:00
|
|
|
|
|
|
|
fs.writeFileSync(`${clientPath}/config/env.json`, JSON.stringify(env))
|