-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from nighca/version-check
build-config 中添加字段指定 builder 版本号
- Loading branch information
Showing
7 changed files
with
71 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* @file prepare behaviors | ||
* @author nighca <[email protected]> | ||
*/ | ||
|
||
const semver = require('semver') | ||
const logger = require('./utils/logger') | ||
const findBuildConfig = require('./utils/build-conf').find | ||
const packageInfo = require('../package.json') | ||
|
||
module.exports = () => findBuildConfig().then( | ||
buildConfig => { | ||
const builderVersionRange = buildConfig.engines && buildConfig.engines.builder | ||
if (typeof builderVersionRange === 'string') { | ||
const builderVersion = packageInfo.version | ||
if (!semver.satisfies(builderVersion, builderVersionRange)) { | ||
logger.warn(`builder version not satisfied, which may causes error (expected \`${builderVersionRange}\`, got \`${builderVersion}\`)`) | ||
} | ||
} | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,5 +55,8 @@ | |
"SecretKey": "", | ||
"bucket": "" | ||
} | ||
}, | ||
"engines": { | ||
"builder": "*" | ||
} | ||
} |