UNPKG

ala-cli

Version:

aladdin develop utils

34 lines (28 loc) 823 B
/** * * @file fis3同步:sync dev files php/js/smarty * @author chenrui09 * @date 2017/5/4 * */ const path = require('path'); let dirRoot = process.cwd(); let appConf = require(path.join(dirRoot, 'app.conf')); let syncConf = appConf.sync; let receiver = syncConf.receiver; let modules = appConf.modules; let rules = syncConf.rules; // 动态规则匹配 for (let key in rules) { let rule = rules[key]; let fisMatch = path.normalize(modules[rule.module] + '/(' + rule.match + ')'); let fisParams = {}; fisParams.release = '$1'; fis.match(fisMatch, fisParams); fis.match(fisMatch, { deploy: fis.plugin('http-push', { receiver: receiver, to: rule.to // 路径不存在请手动创建 }) }); }