beyond
Version:
The Full Stack Universal Typescript Framework
60 lines (48 loc) • 1.4 kB
JavaScript
const { fs } = global.utils;
module.exports = class {
get file() {
return this.
}
constructor(builder) {
this.
}
async
if (this.
this.
const { application } = this.
await application.ready;
await application.deployment.ready;
const target = application.deployment?.build?.path ?? '.beyond/builds';
this.
}
async read() {
await this.
const file = this.
let builds = {};
if (!(await fs.exists(file))) return builds;
try {
const content = await fs.readFile(file);
builds = JSON.parse(content);
} catch (exc) {
console.error(`Error reading or parsing builds information file "${file}"`);
}
return builds;
}
async append(paths, distribution, finalised) {
await this.
const data = await this.read();
data[distribution.name] = {
platform: distribution.platform,
environment: distribution.environment,
compress: distribution.compress,
base: paths.base,
archive: paths.archive,
finalised: !!finalised,
time: Date.now(),
};
await fs.save(this.
}
};