Skip to content

Commit

Permalink
fix(version): limit nodejs version
Browse files Browse the repository at this point in the history
  • Loading branch information
sunYanxl committed Jul 20, 2018
1 parent 9ae90cf commit 537207c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ TSW团队会查看所有的PR,我们会运行一些代码检查和测试,一

当您准备PR时,请确保已经完成以下几个步骤:

1. 将仓库fork下来并基于`dev`分支创建您的开发分支。
1. 将仓库fork下来并且基于`dev`分支创建您的开发分支。
2. 如果您更改了APIs请更新代码及文档。
3. 在您添加的每一个新文件头部加上版权声明。
4. 检查您的代码语法及格式。
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ feature/bugfix PR
```

### Make Pull Requests
The code team will monitor all pull request, we run some code check and test on it. After all tests passed, we will accecpt this PR. But it won't merge to `master` branch at once, which have some delay.
The code team will monitor all pull request, we run some code check and test on it. After all tests passed, we will accecpt this PR,But it won't merge to `master` branch at once, which have some delay.

Before submitting a pull request, please make sure the followings are done:

Expand Down
11 changes: 5 additions & 6 deletions bin/proxy/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@

const arr = process.versions.node.split('.');

if (arr[1].length === 1) {
arr[1] = '0' + arr[1];
if (arr[0] < 8) {
console.error('The nodejs version you installed is ' + process.versions.node);
console.error('Please update the nodejs version to 8.0.0');
process.exit(1);
}

this.nodeVersion = parseFloat([arr[0], arr[1]].join('.'));

if (this.nodeVersion < 8.0 || (this.nodeVersion >= 10.0 && this.nodeVersion <= 10.3)) {
if (arr[0] == 10 && (arr[1] >= 0 && arr[1] <= 3)) {
console.error('The nodejs version you installed is ' + process.versions.node);
console.error('Please update to the nodejs version which greater than 10.4.0');
process.exit(1);
Expand Down

0 comments on commit 537207c

Please sign in to comment.