2017-06-20 23:18:46 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const path = require('path');
|
|
|
|
const fs = require('fs-extra');
|
|
|
|
const { onError } = require('./utils');
|
|
|
|
|
|
|
|
const ROOT = path.resolve(__dirname, '..');
|
|
|
|
|
|
|
|
async function getClean(source) {
|
|
|
|
await fs.remove(source);
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = getClean;
|
|
|
|
|
|
|
|
if (require.main === module) {
|
|
|
|
(async () => {
|
|
|
|
try {
|
|
|
|
await getClean(path.join(ROOT, 'build'));
|
|
|
|
await getClean(path.join(ROOT, '.signatures.json'));
|
2023-08-08 05:32:26 +00:00
|
|
|
await getClean(path.join(ROOT, 'reader/build'));
|
2019-03-28 18:52:22 +00:00
|
|
|
await getClean(path.join(ROOT, 'pdf-worker/build'));
|
2021-02-11 19:48:27 +00:00
|
|
|
await getClean(path.join(ROOT, 'note-editor/build'));
|
2017-06-20 23:18:46 +00:00
|
|
|
} catch (err) {
|
|
|
|
process.exitCode = 1;
|
|
|
|
global.isError = true;
|
|
|
|
onError(err);
|
|
|
|
}
|
|
|
|
})();
|
|
|
|
}
|