forked from tido/plgToMSS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
initPlg.js
executable file
·49 lines (37 loc) · 1.73 KB
/
initPlg.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env node
'use strict';
function main() {
var fs = require('fs-extra');
var path = require('path');
var cwd = process.cwd();
var configFile = path.join(cwd, 'plgconfig.js');
var configTemplate = path.join(__dirname, 'template/plgconfig.js');
var templateSrc = path.join(__dirname, 'template/src');
var templateTest = path.join(__dirname, 'template/test');
fs.copySync(configTemplate, configFile);
var config = require(configFile);
fs.ensureDirSync(config.importDir);
fs.ensureDirSync(config.buildDir);
fs.ensureDirSync(config.srcDir);
fs.copySync(templateSrc, config.srcDir);
fs.ensureDirSync(config.testDir);
fs.copySync(templateTest, config.testDir);
console.log('Initialised %s for plugin development!', cwd);
console.log('Sources in %s', config.srcDir);
console.log('Tests in %s', config.testDir);
console.log('Imports in %s', config.importDir);
console.log('Built plugins in %s', config.buildDir);
if (!fs.existsSync(config.plgPath)) {
console.log('Now edit plgconfig.js and change plgPath to the install location of Sibelius plugins')
} else {
console.log('Sibelius plugins will be installed to %s', config.plgPath);
}
console.log('Edit plgconfig.js to change paths, plugin and category name...');
console.log('Tools available: ');
console.log(' initPlg Sets up directories and template for plugin development');
console.log(' importPlg Copies plugins from Sibelius to local import directory');
console.log(' parsePlg Splits plugin into separate function, globals and dialog .MSS files');
console.log(' buildPlg Combines separate .MSS files into single .plg for deployment');
console.log(' deployPlg Deploys plugin from build directory to Sibelius');
}
main();