mirror of
https://github.com/andre482/O-tie.git
synced 2026-07-22 07:44:11 +00:00
23 lines
598 B
JavaScript
23 lines
598 B
JavaScript
import { copyFileSync, existsSync, mkdirSync } from "fs";
|
|
import { join } from "path";
|
|
|
|
const files = ["main.js", "styles.css", "manifest.json"];
|
|
const target = process.env.OBSIDIAN_PLUGIN_DIR;
|
|
|
|
if (!target) {
|
|
console.error(
|
|
"Set OBSIDIAN_PLUGIN_DIR to your plugin folder, e.g.\n" +
|
|
' OBSIDIAN_PLUGIN_DIR="C:/path/to/vault/.obsidian/plugins/o-tie" npm run deploy'
|
|
);
|
|
process.exit(1);
|
|
}
|
|
|
|
if (!existsSync(target)) {
|
|
mkdirSync(target, { recursive: true });
|
|
}
|
|
|
|
for (const file of files) {
|
|
copyFileSync(join(process.cwd(), file), join(target, file));
|
|
}
|
|
|
|
console.log(`Deployed to ${target}`);
|