From 175f984709840fcbac043de693cb7f197fadb858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Sun, 23 Dec 2018 15:36:56 +0800 Subject: [PATCH] update --- CHANGELOG.md | 2 ++ README.md | 13 +++++-------- build_system.js | 10 +++++++--- package.json | 2 +- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e81c1e..13af836 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # 更新日志 +## [1.0.2] 2018-12-23 +- 执行优化。 ## [1.0.1] 2018-12-21 - 增加对json文件的支持。 diff --git a/README.md b/README.md index bf3339a..413e4c9 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,11 @@ > 🔥 类似sublime的Build System功能, 方便快速调试一些代码片断或想法。 >> 目前只支持少数语言的简单编译调试, 因为vscode原则上只是一个编辑器, 我并不希望把它变成一个IDE, 所以暂时并不打算支持那些需要复杂的编译环境及配置的语言。 +[![Version](https://vsmarketplacebadge.apphb.com/version-short/yutent.build-system.svg)](https://marketplace.visualstudio.com/items?itemName=yutent.build-system) +[![Rating](https://vsmarketplacebadge.apphb.com/rating-short/yutent.build-system.svg)](https://marketplace.visualstudio.com/items?itemName=yutent.build-system) +[![Installs](https://vsmarketplacebadge.apphb.com/installs/yutent.build-system.svg)](https://marketplace.visualstudio.com/items?itemName=yutent.build-system) +[![Build Status](https://travis-ci.org/yutent/build-system.svg?branch=master)](https://travis-ci.org/yutent/build-system) + 目前支持的语言有以下: > - .bat > - .dart @@ -15,14 +20,6 @@ >> 除以上内置的以外, 还支持代码文件内首行以 `#!`开关的环境配置(优先级高于插件内置) - -[![Version](https://vsmarketplacebadge.apphb.com/version-short/yutent.build-system.svg)](https://marketplace.visualstudio.com/items?itemName=yutent.build-system) -[![Rating](https://vsmarketplacebadge.apphb.com/rating-short/yutent.build-system.svg)](https://marketplace.visualstudio.com/items?itemName=yutent.build-system) -[![Installs](https://vsmarketplacebadge.apphb.com/installs/yutent.build-system.svg)](https://marketplace.visualstudio.com/items?itemName=yutent.build-system) -[![Build Status](https://travis-ci.org/yutent/build-system.svg?branch=master)](https://travis-ci.org/yutent/build-system) - - - ![demo](./demo.png) diff --git a/build_system.js b/build_system.js index 053db35..8c4aea2 100644 --- a/build_system.js +++ b/build_system.js @@ -61,7 +61,6 @@ const BuildSystem = { return true }) .then(saved => { - log(this.__DOC__, saved) if (saved) { this.__start__() } @@ -91,7 +90,6 @@ const BuildSystem = { __start__() { this.__parseCmd__() - log(this.__CMD__) if (!this.__CMD__) { return } @@ -107,7 +105,9 @@ const BuildSystem = { __parseCmd__() { let firstLine = this.__DOC__.lineAt(0).text let ext = path.extname(this.__DOC__.fileName) + let file = path.basename(this.__DOC__.fileName) let lang = EXTS[ext] + if (firstLine.startsWith('#!')) { lang = firstLine.slice(2) } @@ -122,7 +122,11 @@ const BuildSystem = { } return vsc.window.showInformationMessage('不支持的语言...') } - this.__CMD__ = `${lang} "${this.__DOC__.fileName}"` + if (ext === '.json') { + this.__CMD__ = lang + } else { + this.__CMD__ = `${lang} "${file}"` + } }, // 在终端内运行 diff --git a/package.json b/package.json index 5c7bbd0..de56dcb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "build-system", "displayName": "sublime build system", "description": "🔥 类似sublime的Build System功能, 方便快速调试一些代码片断或想法。", - "version": "1.0.1", + "version": "1.0.2", "publisher": "yutent", "author": "Yutent [@yutent]", "icon": "logo.png",