-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.js
More file actions
23 lines (22 loc) · 820 Bytes
/
init.js
File metadata and controls
23 lines (22 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var bower = require('bower');
var fis = require('fis');
var _ = fis.util;
var pkgJSON = _.readJSON('./package.json');
var tfiAddr = __dirname + '\\..\\.bin\\tfi';
_.write('./.tfi/release.bat', [
'cd /d %~dp0/../\n',
tfiAddr + ' release -c -f .tfi\\conf.js',
tfiAddr + ' server open'
].join('\n'));
_.copy(__dirname + '/conf-default.js', './.tfi/conf.js');
if (pkgJSON && pkgJSON.bower) {
_.write('./bower.json', JSON.stringify(pkgJSON.bower));
bower.commands.install().on('log', function(data){
console.log('bower ' + '\t' + data.id.blue + '\t\t' + data.message.green)
}).on('end', function(){
console.log('bower依赖安装完毕'.bold);
_.del('./bower.json');
});
} else {
console.log('无法安装依赖,缺少package.json或者缺少bower属性')
}