Skip to content

Commit

Permalink
fix(version): restricted version
Browse files Browse the repository at this point in the history
  • Loading branch information
sunYanxl committed Jul 20, 2018
1 parent 07947d1 commit 9ae90cf
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ feature/bugfix PR
```

### PR流程
TSW团队会查看所有的PR,我们会运行一些代码检查和测试,一经测试通过,我们会接受这次PR,但不会立即将代码合并到master分支上,会有一点延迟
TSW团队会查看所有的PR,我们会运行一些代码检查和测试,一经测试通过,我们会接受这次PR,但不会立即将代码合并到master分支上,会有一些延迟

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

1. 将仓库fork下来并基于`master`分支创建您的开发分支。
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 @@ -37,7 +37,7 @@ The code team will monitor all pull request, we run some code check and test on

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

1. Fork the repo and create your branch from `master`.
1. Fork the repo and create your branch from `dev`.
2. Update code or documentation if you have changed APIs.
3. Add the copyright notice to the top of any new files you've added.
4. Check your code lints and checkstyles.
Expand Down
2 changes: 2 additions & 0 deletions bin/proxy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

const plug = require('../tsw/plug.js');

require('./version.js');

plug('runtime/Console.hack.js');
plug('runtime/fs.hack.js');
plug('runtime/Dns.hack.js');
Expand Down
23 changes: 23 additions & 0 deletions bin/proxy/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* !
* Tencent is pleased to support the open source community by making Tencent Server Web available.
* Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
'use strict';


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

if (arr[1].length === 1) {
arr[1] = '0' + arr[1];
}

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

if (this.nodeVersion < 8.0 || (this.nodeVersion >= 10.0 && this.nodeVersion <= 10.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);
}

0 comments on commit 9ae90cf

Please sign in to comment.