Fixing CLI build - prebuilds required for hashing can be disabled via environment variable.

This commit is contained in:
mike12345567 2022-09-13 18:00:10 +01:00
parent a0f43107be
commit 27518cb678
5 changed files with 8 additions and 2 deletions

View File

@ -25,6 +25,7 @@
"@techpass/passport-openidconnect": "0.3.2",
"aws-sdk": "2.1030.0",
"bcrypt": "5.0.1",
"bcryptjs": "2.4.3",
"dotenv": "16.0.1",
"emitter-listener": "1.1.2",
"ioredis": "4.28.0",

View File

@ -19,6 +19,7 @@ if (!LOADED && isDev() && !isTest()) {
const env = {
isTest,
isDev,
JS_BCRYPT: process.env.JS_BCRYPT,
JWT_SECRET: process.env.JWT_SECRET,
COUCH_DB_URL: process.env.COUCH_DB_URL || "http://localhost:4005",
COUCH_DB_USERNAME: process.env.COUCH_DB_USER,

View File

@ -1,5 +1,5 @@
const bcrypt = require("bcrypt")
const env = require("./environment")
const bcrypt = env.JS_BCRYPT ? require("bcryptjs") : require("bcrypt")
const { v4 } = require("uuid")
const SALT_ROUNDS = env.SALT_ROUNDS || 10

View File

@ -1 +1,2 @@
process.env.NO_JS = "1"
process.env.JS_BCRYPT = "1"

View File

@ -27,7 +27,10 @@ function checkForBinaries() {
}
function cleanup(evt) {
if (evt && evt.errno) {
if (!isNaN(evt)) {
return
}
if (evt) {
console.error(
error(
"Failed to run CLI command - please report with the following message:"