Skip to content

Commit e3c2806

Browse files
committed
fix: Failing builds for R and httpie
1 parent f63de4e commit e3c2806

File tree

5 files changed

+59
-21
lines changed

5 files changed

+59
-21
lines changed

codegens/r-httr/test/ci-install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ echo "Installing dependencies required for tests in codegens/r-httr"
55
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
66
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
77
sudo apt-get update
8-
sudo apt-get install r-base
8+
sudo apt-get install r-base libcurl4-gnutls-dev
99
sudo R --vanilla -e 'install.packages("httr", version="1.4.2", repos="http://cran.us.r-project.org")'

codegens/r-rcurl/test/ci-install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ echo "Installing dependencies required for tests in codegens/r-httr"
55
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
66
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
77
sudo apt-get update
8-
sudo apt-get install r-base
8+
sudo apt-get install r-base libcurl4-gnutls-dev
99
sudo R --vanilla -e 'install.packages("RCurl", version="1.98.1.6", repos="http://cran.us.r-project.org")'
+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/usr/bin/env node
2+
var shell = require('shelljs'),
3+
chalk = require('chalk'),
4+
async = require('async'),
5+
ESLintCLIEngine = require('eslint').CLIEngine,
6+
7+
/**
8+
* The list of source code files / directories to be linted.
9+
*
10+
* @type {Array}
11+
*/
12+
LINT_SOURCE_DIRS = [
13+
'./lib',
14+
'./test',
15+
'./npm/*.js',
16+
'./index.js'
17+
];
18+
19+
module.exports = function (exit) {
20+
// banner line
21+
console.info(chalk.yellow.bold('\nLinting files using eslint...'));
22+
23+
async.waterfall([
24+
25+
/**
26+
* Instantiates an ESLint CLI engine and runs it in the scope defined within LINT_SOURCE_DIRS.
27+
*
28+
* @param {Function} next - The callback function whose invocation marks the end of the lint test run.
29+
* @returns {*}
30+
*/
31+
function (next) {
32+
next(null, (new ESLintCLIEngine()).executeOnFiles(LINT_SOURCE_DIRS));
33+
},
34+
35+
/**
36+
* Processes a test report from the Lint test runner, and displays meaningful results.
37+
*
38+
* @param {Object} report - The overall test report for the current lint test.
39+
* @param {Object} report.results - The set of test results for the current lint run.
40+
* @param {Function} next - The callback whose invocation marks the completion of the post run tasks.
41+
* @returns {*}
42+
*/
43+
function (report, next) {
44+
var errorReport = ESLintCLIEngine.getErrorResults(report.results);
45+
// log the result to CLI
46+
console.info(ESLintCLIEngine.getFormatter()(report.results));
47+
// log the success of the parser if it has no errors
48+
(errorReport && !errorReport.length) && console.info(chalk.green('eslint ok!'));
49+
// ensure that the exit code is non zero in case there was an error
50+
next(Number(errorReport && errorReport.length) || 0);
51+
}
52+
], exit);
53+
};
54+
55+
// ensure we run this script exports if this is a direct stdin.tty run
56+
!module.parent && module.exports(shell.exit);

codegens/shell-httpie/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"scripts": {
1717
"test": "./scripts/test.sh",
18-
"test-lint": "./scripts/test-lint.sh",
18+
"test-lint": "node npm/test-lint.js",
1919
"test-unit": "./scripts/test-unit.sh",
2020
"coverage": "nyc report --reporter=html --reporter=text mocha"
2121
},

codegens/shell-httpie/scripts/test-lint.sh

-18
This file was deleted.

0 commit comments

Comments
 (0)