Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
feat(messages): 更新提示信息
Browse files Browse the repository at this point in the history
  • Loading branch information
NewFuture committed Aug 31, 2019
1 parent 4ef2a05 commit 785ca9e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function loadConfig(configFile) {
var config = json5.parse(json);
// @ts-ignore
const version = require('../package.json').version;
log.info(TITLE, colors.cyan.italic(`v${version}`), 'load config', colors.blue.underline(configFile))
log.info(TITLE, colors.cyan.italic.dim(`v${version}`), colors.gray.dim('load config'), colors.gray.bold.underline(configFile))
const allowedKeys = Object.keys(exports.default);

config = Object.keys(config)
Expand Down
9 changes: 6 additions & 3 deletions src/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,15 @@ gulp.task('build', gulp.series('clean', 'compile'));
// 监测文件修改
gulp.task('watch', gulp.series(
gulp.parallel('js-watch', 'wxs-watch', 'wxss-watch', 'wxml-watch', 'json-watch', 'image-watch', 'copy-watch', 'npm-watch'),
taskLog(rainbow('All watching tasks started ...')))
taskLog(colors.greenBright.bold('\tAll watch tasks started !')))
);

//开发模式
gulp.task('dev', gulp.series('try-quit', 'clean', 'compile', gulp.parallel('try-open', 'watch')));
gulp.task('dev', gulp.series(
'try-quit', 'clean', 'compile',
gulp.parallel('try-open', 'watch'),
taskLog(colors.inverse(rainbow('all tasks are ready, waiting for code change ...')))
));

gulp.on('error', console.trace);
gulp.on('error', error('gulp'));

9 changes: 5 additions & 4 deletions src/tasks/devtool.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ exports.close = function (pass) {
* 退出
*/
exports.quit = function (pass) {
logger.info(TITLE, startIcon, colors.cyan('quit'), colors.gray('尝试退出微信开发者工具...'))
logger.info(TITLE, startIcon, colors.cyan('quit'), 'Wechat Devtools', colors.gray('尝试退出微信开发者工具...'))
return exports.isOpenPort().then(function (isOpen) {
if (isOpen) {
return devtool.cli('--quit', path.resolve(exports.dist))
Expand Down Expand Up @@ -130,14 +130,15 @@ function getSize(path) {
*/
exports.upload = function () {
const version = devtool.getPkgVersion() || '0.0.0';
const uploadProject = version + '@' + path.resolve(exports.dist);
logger.info(TITLE, startIcon, colors.cyan('upload'), 'project in', colors.underline(uploadProject));
const dist = path.resolve(exports.dist);
const uploadProject = version + '@' + dist;
logger.info(TITLE, startIcon, colors.cyan('upload'), 'project in', colors.underline(dist));
const logPath = path.join(os.tmpdir(), 'mplog-' + version + '-' + Date.now() + '.json')

return devtool.getCommitMsg()
.then(function (message) {
message = (message || process.env.npm_package_description || '').trim().substr(0, 2048)
logger.info(TITLE, colors.gray(message.split('\n', 1)[0]))
logger.info(TITLE, colors.gray.bold(version + ':'), colors.dim.gray.underline(message.split('\n', 1)[0]))
return devtool.cli('--upload', uploadProject, '--upload-info-output', logPath, '--upload-desc', encodeURI(message))
})
.then(function (res) {
Expand Down

0 comments on commit 785ca9e

Please sign in to comment.