Lint hak scripts

This commit is contained in:
David Baker 2020-02-17 14:52:24 +00:00
parent 5fc72e8f73
commit fa3925194d
3 changed files with 19 additions and 19 deletions

View File

@ -15,7 +15,7 @@ limitations under the License.
*/
const path = require('path');
const child_process = require('child_process');
const childProcess = require('child_process');
const mkdirp = require('mkdirp');
const fsExtra = require('fs-extra');
@ -28,7 +28,7 @@ module.exports = async function(hakEnv, moduleInfo) {
await buildSqlCipherUnix(hakEnv, moduleInfo);
}
await buildMatrixSeshat(hakEnv, moduleInfo);
}
};
async function buildOpenSslWin(hakEnv, moduleInfo) {
const openSslDir = path.join(moduleInfo.moduleDotHakDir, 'openssl-1.1.1d');
@ -37,7 +37,7 @@ async function buildOpenSslWin(hakEnv, moduleInfo) {
console.log("Building openssl in " + openSslDir);
await new Promise((resolve, reject) => {
const proc = child_process.spawn(
const proc = childProcess.spawn(
'perl',
[
'Configure',
@ -103,7 +103,7 @@ async function buildOpenSslWin(hakEnv, moduleInfo) {
});
await new Promise((resolve, reject) => {
const proc = child_process.spawn(
const proc = childProcess.spawn(
'nmake',
['build_libs'],
{
@ -117,7 +117,7 @@ async function buildOpenSslWin(hakEnv, moduleInfo) {
});
await new Promise((resolve, reject) => {
const proc = child_process.spawn(
const proc = childProcess.spawn(
'nmake',
['install_dev'],
{
@ -138,13 +138,13 @@ async function buildSqlCipherWin(hakEnv, moduleInfo) {
await mkdirp(buildDir);
await new Promise((resolve, reject) => {
const proc = child_process.spawn(
const proc = childProcess.spawn(
'nmake',
['/f', path.join('..', 'Makefile.msc'), 'libsqlite3.lib', 'TOP=..'],
{
cwd: buildDir,
stdio: 'inherit',
env: Object.assign({}, process.env, {
env: Object.assign({}, process.env, {
CCOPTS: "-DSQLITE_HAS_CODEC -I" + path.join(moduleInfo.depPrefix, 'include'),
LTLIBPATHS: "/LIBPATH:" + path.join(moduleInfo.depPrefix, 'lib'),
LTLIBS: "libcrypto.lib",
@ -185,7 +185,7 @@ async function buildSqlCipherUnix(hakEnv, moduleInfo) {
}
await new Promise((resolve, reject) => {
const proc = child_process.spawn(
const proc = childProcess.spawn(
path.join(sqlCipherDir, 'configure'),
args,
{
@ -199,7 +199,7 @@ async function buildSqlCipherUnix(hakEnv, moduleInfo) {
});
await new Promise((resolve, reject) => {
const proc = child_process.spawn(
const proc = childProcess.spawn(
'make',
[],
{
@ -213,7 +213,7 @@ async function buildSqlCipherUnix(hakEnv, moduleInfo) {
});
await new Promise((resolve, reject) => {
const proc = child_process.spawn(
const proc = childProcess.spawn(
'make',
['install'],
{
@ -240,7 +240,7 @@ async function buildMatrixSeshat(hakEnv, moduleInfo) {
console.log("Running neon with env", env);
await new Promise((resolve, reject) => {
const proc = child_process.spawn(
const proc = childProcess.spawn(
path.join(moduleInfo.nodeModuleBinDir, 'neon' + (hakEnv.isWin() ? '.cmd' : '')),
['build', '--release'],
{

View File

@ -15,7 +15,7 @@ limitations under the License.
*/
const path = require('path');
const child_process = require('child_process');
const childProcess = require('child_process');
const fs = require('fs');
const fsProm = require('fs').promises;
@ -28,7 +28,7 @@ module.exports = async function(hakEnv, moduleInfo) {
if (hakEnv.isWin()) {
getOpenSsl(hakEnv, moduleInfo);
}
}
};
async function getSqlCipher(hakEnv, moduleInfo) {
const sqlCipherDir = path.join(moduleInfo.moduleDotHakDir, 'sqlcipher-4.3.0');
@ -52,7 +52,7 @@ async function getSqlCipher(hakEnv, moduleInfo) {
haveSqlcipherTar = false;
}
if (!haveSqlcipherTar) {
const bob = needle('get', 'https://github.com/sqlcipher/sqlcipher/archive/v4.3.0.tar.gz', {
const bob = needle('get', 'https://github.com/sqlcipher/sqlcipher/archive/v4.3.0.tar.gz', {
follow: 10,
output: sqlCipherTarball,
});
@ -71,9 +71,9 @@ async function getSqlCipher(hakEnv, moduleInfo) {
const patchFile = path.join(moduleInfo.moduleHakDir, 'sqlcipher-4.3.0-win.patch');
await new Promise((resolve, reject) => {
const readStream = fs.createReadStream(patchFile);
const readStream = fs.createReadStream(patchFile);
const proc = child_process.spawn(
const proc = childProcess.spawn(
'patch',
['-p1'],
{
@ -84,7 +84,7 @@ async function getSqlCipher(hakEnv, moduleInfo) {
proc.on('exit', (code) => {
code ? reject(code) : resolve();
});
readStream.pipe(proc.stdin);
readStream.pipe(proc.stdin);
});
}
}
@ -117,7 +117,7 @@ async function getOpenSsl(hakEnv, moduleInfo) {
});
}
console.log("extracting " + openSslTarball + " in " + moduleInfo.moduleDotHakDir);
console.log("extracting " + openSslTarball + " in " + moduleInfo.moduleDotHakDir);
await tar.x({
file: openSslTarball,
cwd: moduleInfo.moduleDotHakDir,

View File

@ -16,7 +16,7 @@
"fetch": "yarn run mkdirs && node scripts/fetch-package.js",
"setversion": "node scripts/set-version.js",
"start": "electron .",
"lint": "eslint src/ scripts/",
"lint": "eslint src/ scripts/ hak/",
"build": "yarn run setversion && electron-builder",
"in-docker": "scripts/in-docker.sh",
"docker:build": "yarn run in-docker yarn run build",