From 9f366d6cfa08fb685c2c92326bdc4aad177e9313 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 30 Aug 2018 07:23:57 +0000 Subject: [PATCH 1/4] chore(package): update standard to version 12.0.1 Closes #70 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9686436..60c4164 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "devDependencies": { "cli-color": "1.3.0", "execSync": "1.0.2", - "standard": "^10.0.2", + "standard": "^12.0.1", "tape": "4.8.0" }, "dependencies": { From 0bcd2bf54058f7cb598529698edfb55682cd4a99 Mon Sep 17 00:00:00 2001 From: retrohacker Date: Wed, 21 Nov 2018 19:00:37 -0800 Subject: [PATCH 2/4] fix linting --- index.js | 2 +- tests/runTest.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 7a5bfdd..3de13aa 100644 --- a/index.js +++ b/index.js @@ -21,7 +21,7 @@ module.exports = function getOs (cb) { // Linux is a special case. if (osName === 'linux') return getLinuxDistro(cb) // Else, node's builtin is acceptable. - return cb(null, {'os': osName}) + return cb(null, { 'os': osName }) } /** diff --git a/tests/runTest.js b/tests/runTest.js index c50379a..0c874d8 100644 --- a/tests/runTest.js +++ b/tests/runTest.js @@ -27,7 +27,7 @@ distros.forEach(function (v1) { // Build the docker image using the dockerfile process.stdout.write('Building version ' + v2 + ' of ' + capitalize(v1) + '... ') try { - var dockerResult = execSync('docker build -t "getos:' + v1 + v2 + '" .', {stdio: []}) + var dockerResult = execSync('docker build -t "getos:' + v1 + v2 + '" .', { stdio: [] }) } catch (e) { dockerResult = dockerResult || {} dockerResult.code = e @@ -40,7 +40,7 @@ distros.forEach(function (v1) { process.stdout.write('Running container... ') // Show output from distribution try { - var nodeResult = execSync('docker run -d getos:' + v1 + v2, {stdio: []}) + var nodeResult = execSync('docker run -d getos:' + v1 + v2, { stdio: [] }) } catch (e) { nodeResult = nodeResult || {} nodeResult.code = e @@ -50,7 +50,7 @@ distros.forEach(function (v1) { process.stdout.write('[' + color.red('FAILED!') + ']\n') } else { try { - var dockerLog = execSync('sleep 2s && docker logs ' + (nodeResult.stdout || nodeResult.toString()), {stdio: []}) + var dockerLog = execSync('sleep 2s && docker logs ' + (nodeResult.stdout || nodeResult.toString()), { stdio: [] }) } catch (e) { dockerLog = dockerLog || {} dockerLog.code = e From cfd95728bdfca15d081d35a6bd92203c57e71f33 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 21 Nov 2018 13:15:41 -0800 Subject: [PATCH 3/4] Use relative paths for modules --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 7a5bfdd..c20a492 100644 --- a/index.js +++ b/index.js @@ -121,7 +121,7 @@ function getName (candidate) { * Loads a custom logic module to populate additional distribution information */ function customLogic (os, name, file, cb) { - var logic = path.join(__dirname, 'logic/' + name + '.js') + var logic = './logic/' + name + '.js'; try { require(logic)(os, file, cb) } catch (e) { cb(null, os) } } From 1ca442c43727092a22ece7c668254dd492b186c8 Mon Sep 17 00:00:00 2001 From: retrohacker Date: Wed, 21 Nov 2018 19:03:09 -0800 Subject: [PATCH 4/4] fix lint --- index.js | 5 ++--- tests/runTest.js | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index c20a492..ae5137b 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,6 @@ var async = require('async') var distros = require('./os.json') var fs = require('fs') var os = require('os') -var path = require('path') /** * Begin definition of globals. @@ -21,7 +20,7 @@ module.exports = function getOs (cb) { // Linux is a special case. if (osName === 'linux') return getLinuxDistro(cb) // Else, node's builtin is acceptable. - return cb(null, {'os': osName}) + return cb(null, { 'os': osName }) } /** @@ -121,7 +120,7 @@ function getName (candidate) { * Loads a custom logic module to populate additional distribution information */ function customLogic (os, name, file, cb) { - var logic = './logic/' + name + '.js'; + var logic = './logic/' + name + '.js' try { require(logic)(os, file, cb) } catch (e) { cb(null, os) } } diff --git a/tests/runTest.js b/tests/runTest.js index c50379a..0c874d8 100644 --- a/tests/runTest.js +++ b/tests/runTest.js @@ -27,7 +27,7 @@ distros.forEach(function (v1) { // Build the docker image using the dockerfile process.stdout.write('Building version ' + v2 + ' of ' + capitalize(v1) + '... ') try { - var dockerResult = execSync('docker build -t "getos:' + v1 + v2 + '" .', {stdio: []}) + var dockerResult = execSync('docker build -t "getos:' + v1 + v2 + '" .', { stdio: [] }) } catch (e) { dockerResult = dockerResult || {} dockerResult.code = e @@ -40,7 +40,7 @@ distros.forEach(function (v1) { process.stdout.write('Running container... ') // Show output from distribution try { - var nodeResult = execSync('docker run -d getos:' + v1 + v2, {stdio: []}) + var nodeResult = execSync('docker run -d getos:' + v1 + v2, { stdio: [] }) } catch (e) { nodeResult = nodeResult || {} nodeResult.code = e @@ -50,7 +50,7 @@ distros.forEach(function (v1) { process.stdout.write('[' + color.red('FAILED!') + ']\n') } else { try { - var dockerLog = execSync('sleep 2s && docker logs ' + (nodeResult.stdout || nodeResult.toString()), {stdio: []}) + var dockerLog = execSync('sleep 2s && docker logs ' + (nodeResult.stdout || nodeResult.toString()), { stdio: [] }) } catch (e) { dockerLog = dockerLog || {} dockerLog.code = e