Skip to content

Commit e53d1c8

Browse files
author
Ilya Radchenko
committed
Custom node version (#35)
* Update webapp.js * Tweak config to match webapp * Add customVersion config * Use custom version if 'custom' runtime set * Add custom version input * Add n usage href * Update n version * v0.7.0 - Add custom version for node - Add lts runtime - Remove node 0.8 from runtime - Update n to ^2.1.0
1 parent 17a214e commit e53d1c8

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

config/config.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ <h2>
2121
Select <em>whatever</em> if you want to just use whatever version of
2222
the fork is on your machine.
2323
</p>
24+
25+
<div ng-if="config.runtime === 'custom'">
26+
<label for="custom-version" class="bold-label">Custom Version</label>
27+
<input type="text" ng-model="config.customVersion" placeholder="Custom Version">
28+
<p class="help-test">
29+
Input a custom version, based on the allowed input for <a href="https://github.com/tj/n#usage" target="_blank">n ___</a>.
30+
Valid input includes '4.3' or '5.1.1' (without the quotes).
31+
</p>
32+
</div>
2433

2534
<label for="node-test-command" class="bold-label">Test Command</label>
2635
<select id="node-test-command" ng-change="save()" ng-model="config.test" placeholder="Test Command">

config/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
app.controller('NodeController', ['$scope', function ($scope) {
3-
$scope.nodeVersions = ['0.8', '0.10', '0.12', 'stable', 'latest', 'whatever'];
3+
$scope.nodeVersions = ['0.10', '0.12', 'lts', 'stable', 'latest', 'whatever', 'custom'];
44
$scope.ioVersions = ['stable', 'latest', 'whatever'];
55
$scope.saving = false;
66

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "strider-node",
3-
"version": "0.6.6",
3+
"version": "0.7.0",
44
"description": "Run Nodejs tests in Strider",
55
"main": "worker.js",
66
"scripts": {
@@ -18,7 +18,7 @@
1818
"license": "BSD",
1919
"dependencies": {
2020
"npm": "^2.7.1",
21-
"n": "^1.3.0",
21+
"n": "^2.1.0",
2222
"md5": "^2.0.0",
2323
"async": "^1.0.0",
2424
"fs-extra": "^0.8.1"

webapp.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ module.exports = {
99
},
1010
runtime: {
1111
type: String,
12-
enum: ['0.8', '0.10', '0.12', 'stable', 'latest', 'whatever'],
12+
enum: ['0.10', '0.12', 'lts', 'stable', 'latest', 'whatever', 'custom'],
1313
default: 'whatever'
1414
},
15+
customVersion: {
16+
type: String,
17+
default: '4.3'
18+
},
1519
caching: {
1620
type: String,
1721
enum: ['strict', 'loose', 'none'],

worker.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,10 @@ module.exports = {
9090
path.join(__dirname, 'node_modules/n/bin'),
9191
ret.env.N_PREFIX + '/bin'
9292
]);
93+
94+
var version = config.runtime === 'custom' ? config.customVersion : config.runtime;
9395

94-
ret.environment = 'n ' + (config.fork === 'io.js' ? 'io ' : '') + config.runtime;
96+
ret.environment = 'n ' + (config.fork === 'io.js' ? 'io ' : '') + version;
9597
ret.cleanup = 'n prev';
9698
}
9799

0 commit comments

Comments
 (0)