-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.ts
More file actions
30 lines (24 loc) · 938 Bytes
/
Copy pathbuild.ts
File metadata and controls
30 lines (24 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { build } from "@sharkord/plugin-builder";
import { PLUGIN_SDK_VERSION } from "@sharkord/plugin-sdk";
import fs from "fs/promises";
import path from "path";
const copyPluginToSharkord = async (builtPluginPath: string) => {
// adjust if necessary
const sharkordPluginsPath = `${process.env.HOME}/.config/sharkord/plugins`;
const targetPluginPath = path.join(
sharkordPluginsPath,
path.basename(builtPluginPath),
);
console.log(
`Copying built plugin from ${builtPluginPath} to ${targetPluginPath}...`,
);
await fs.rm(targetPluginPath, { recursive: true, force: true });
await fs.cp(builtPluginPath, targetPluginPath, {
recursive: true,
});
};
const result = await build({
sdkVersion: PLUGIN_SDK_VERSION,
});
// uncomment the following line to move the built plugin directly to the Sharkord plugins directory, useful for development and testing
// await copyPluginToSharkord(result.outDir);