19 lines
602 B
TypeScript
19 lines
602 B
TypeScript
|
|
#!/usr/bin/env node
|
||
|
|
|
||
|
|
import { promises as fs } from "fs";
|
||
|
|
import { createZPM } from "@link-stack/zammad-addon-common/build";
|
||
|
|
|
||
|
|
const log = (msg: string, data?: Record<string, any>) => {
|
||
|
|
console.log(JSON.stringify({ msg, ...data, timestamp: new Date().toISOString() }));
|
||
|
|
};
|
||
|
|
|
||
|
|
const main = async () => {
|
||
|
|
const packageJSON = JSON.parse(await fs.readFile("./package.json", "utf-8"));
|
||
|
|
const { name: fullName, displayName, version } = packageJSON;
|
||
|
|
log('Building addon', { displayName, version });
|
||
|
|
const name = fullName.split("/").pop();
|
||
|
|
await createZPM({ name, displayName, version });
|
||
|
|
};
|
||
|
|
|
||
|
|
main();
|