chore: speed up make startup time by using jq (#958)

By changing the `Makefile` to use `jq` instead of `node` for getting settings
from `package.json`, the time to do `make help` drops from over 1.5 seconds to
under 0.05 seconds!
This commit is contained in:
Andrew Scheller 2016-12-08 15:57:22 +00:00 committed by Juan Cruz Viotti
parent c14257720f
commit 4090fe93ad
3 changed files with 8 additions and 5 deletions

View File

@ -24,6 +24,7 @@ addons:
- clang - clang
- dpkg - dpkg
- fakeroot - fakeroot
- jq
before_install: before_install:
- rm -rf ~/.nvm - rm -rf ~/.nvm
@ -46,6 +47,7 @@ install:
- npm install -g electron-installer-debian - npm install -g electron-installer-debian
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew install afsctool; brew install afsctool;
brew install jq;
fi fi
- make electron-develop - make electron-develop

View File

@ -2,11 +2,11 @@
# Application configuration # Application configuration
# --------------------------------------------------------------------- # ---------------------------------------------------------------------
ELECTRON_VERSION = $(shell node -e "console.log(require('./package.json').devDependencies['electron-prebuilt'])") ELECTRON_VERSION = $(shell jq -r '.devDependencies["electron-prebuilt"]' package.json)
APPLICATION_NAME = $(shell node -e "console.log(require('./package.json').displayName)") APPLICATION_NAME = $(shell jq -r '.displayName' package.json)
APPLICATION_DESCRIPTION=$(shell node -e "console.log(require('./package.json').description)") APPLICATION_DESCRIPTION=$(shell jq -r '.description' package.json)
APPLICATION_VERSION = $(shell node -e "console.log(require('./package.json').version)") APPLICATION_VERSION = $(shell jq -r '.version' package.json)
APPLICATION_COPYRIGHT = $(shell node -e "console.log(require('./package.json').copyright)") APPLICATION_COPYRIGHT = $(shell jq -r '.copyright' package.json)
APPLICATION_CATEGORY = public.app-category.developer-tools APPLICATION_CATEGORY = public.app-category.developer-tools
APPLICATION_BUNDLE_ID = io.resin.etcher APPLICATION_BUNDLE_ID = io.resin.etcher
APPLICATION_FILES = lib,build,assets APPLICATION_FILES = lib,build,assets

View File

@ -14,6 +14,7 @@ Prerequisites
- [UPX](http://upx.sourceforge.net) - [UPX](http://upx.sourceforge.net)
- [Python](https://www.python.org) - [Python](https://www.python.org)
- [SCSS Lint](https://github.com/brigade/scss-lint/) - [SCSS Lint](https://github.com/brigade/scss-lint/)
- [jq](https://stedolan.github.io/jq/)
### Windows ### Windows