-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.js
34 lines (28 loc) · 938 Bytes
/
install.js
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
#!/usr/bin/env node
const path = require("path");
const fs = require('fs-extra');
const yargs = require('yargs/yargs');
const { hideBin } = require('yargs/helpers');
const argv = yargs(hideBin(process.argv)).argv;
const cwd = process.cwd();
if (!argv?.framework){
console.log("Missing --framework flag.");
process.exit(1);
} else if (!argv?.audio){
console.log("Missing --audio flag.");
process.exit(1);
}
// Relocate audio files
const audio = path.join(__dirname, "dist", "audio");
const audioDest = path.resolve(cwd, argv.audio);
if (fs.existsSync(audioDest)){
fs.rmdirSync(audioDest, { recursive: true });
}
fs.copySync(audio, audioDest);
// Relocate framework
const framework = path.join(__dirname, "dist", "framework");
const frameworkDest = path.resolve(cwd, argv.framework);
if (fs.existsSync(frameworkDest)){
fs.rmdirSync(frameworkDest, { recursive: true });
}
fs.copySync(framework, frameworkDest);