Skip to content

Commit

Permalink
use DEBUG env var instead of CI
Browse files Browse the repository at this point in the history
  • Loading branch information
cernytomas authored and Dexus committed Apr 5, 2024
1 parent 875cf35 commit 3d71b87
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ concurrency:
cancel-in-progress: true
env:
TARGET: x86_64-unknown-linux-gnu
DEBUG: true
jobs:
build:
name: Build and Test PEM
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tests_output.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
workflow_dispatch:
env:
TARGET: x86_64-unknown-linux-gnu
DEBUG: true
jobs:
build:
name: RuN!!!!
Expand Down
2 changes: 1 addition & 1 deletion lib/debug.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function debug (title, content) {
if (process.env.CI === 'true') {
if (process.env.DEBUG === 'true') {
console.log(`::group::${title}`)
console.log(JSON.stringify(content, null, 3))
console.log('::endgroup::')
Expand Down
2 changes: 1 addition & 1 deletion lib/openssl.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var tempDir = process.env.PEMJS_TMPDIR || osTmpdir()

const versionRegEx = new RegExp('^(OpenSSL|LibreSSL) (((\\d+).(\\d+)).(\\d+))([a-z]+)?')

if ("CI" in process.env && process.env.CI === 'true') {
if ("DEBUG" in process.env && process.env.DEBUG === 'true') {
if ("LIBRARY" in process.env && "VERSION" in process.env && process.env.LIBRARY != "" && process.env.VERSION != "") {
const filePathOpenSSL=`./openssl/${process.env.LIBRARY}_v${process.env.VERSION}/bin/openssl`
if (fs.existsSync(filePathOpenSSL)) {
Expand Down
2 changes: 1 addition & 1 deletion test/pem.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ chai.use(dirtyChai)

process.env.PEMJS_TMPDIR = './tmp'
debug("ENVs:", process.env)
if ((process.env.TRAVIS === 'true' || process.env.CI === 'true') && "OPENSSL_DIR" in process.env && !("OPENSSL_BIN" in process.env)) {
if ((process.env.TRAVIS === 'true' || process.env.DEBUG === 'true') && "OPENSSL_DIR" in process.env && !("OPENSSL_BIN" in process.env)) {
process.env.OPENSSL_BIN = process.env.GITHUB_WORKSPACE+'/openssl/bin/openssl'
}

Expand Down

0 comments on commit 3d71b87

Please sign in to comment.