generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpack.mjs
39 lines (33 loc) · 844 Bytes
/
pack.mjs
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
31
32
33
34
35
36
37
38
39
import fs from 'fs-extra'
import { join } from 'path';
// remove templates
const templates = "./dist/Templates";
if (fs.existsSync(templates)) {
fs.rmSync(templates,{recursive: true});
}
// copy assets
console.log("Copying assets...");
[
"manifest.json",
"styles.css",
"Templates"
].forEach(f => {
const target = join("./dist", f);
console.log(`${f} => ${target}`);
fs.copySync(f, target);
});
// configure test code
console.log("Configuring regression tests...");
try {
fs.exists("./test/scripts/FeedAssembler.js");
} catch (err) {
process.exit(0);
}
try {
fs.renameSync("./test/scripts/FeedAssembler.js", "./test/scripts/FeedAssembler.mjs");
console.log("src/FeedAssembler.ts => test/scripts/FeedAssembler.mjs");
} catch (err) {
console.error(err);
process.exit(1);
}
process.exit(0);