WhatsApp/Signal/Formstack/admin updates
This commit is contained in:
parent
bcecf61a46
commit
d0cc5a21de
451 changed files with 16139 additions and 39623 deletions
|
|
@ -4,9 +4,12 @@ import { promises as fs } from "fs";
|
|||
import { glob } from "glob";
|
||||
import path from "path";
|
||||
import os from "os";
|
||||
import { createLogger } from "@link-stack/logger";
|
||||
|
||||
const logger = createLogger('zammad-addon-build');
|
||||
|
||||
const packageFile = async (actualPath: string): Promise<any> => {
|
||||
console.info(`Packaging: ${actualPath}`);
|
||||
logger.info({ actualPath }, 'Packaging file');
|
||||
const packagePath = actualPath.slice(4);
|
||||
const data = await fs.readFile(actualPath, "utf-8");
|
||||
const content = Buffer.from(data, "utf-8").toString("base64");
|
||||
|
|
@ -74,10 +77,10 @@ export const createZPM = async ({
|
|||
|
||||
for (const file of files) {
|
||||
await fs.unlink(file);
|
||||
console.info(`${file} was deleted`);
|
||||
logger.info({ file }, 'File was deleted');
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
logger.error({ error: err }, 'Error removing old addon files');
|
||||
}
|
||||
await fs.writeFile(
|
||||
`../../docker/zammad/addons/${name}-v${version}.zpm`,
|
||||
|
|
@ -89,7 +92,7 @@ export const createZPM = async ({
|
|||
const main = async () => {
|
||||
const packageJSON = JSON.parse(await fs.readFile("./package.json", "utf-8"));
|
||||
const { name: fullName, displayName, version } = packageJSON;
|
||||
console.info(`Building addon ${displayName} v${version}`);
|
||||
logger.info({ displayName, version }, 'Building addon');
|
||||
const name = fullName.split("/").pop();
|
||||
await createZPM({ name, displayName, version });
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue