Skip to content

Commit

Permalink
fix: gather-buildtime-info.cjs windows compat (#92)
Browse files Browse the repository at this point in the history
caused by
#91

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
  • Loading branch information
jkowalleck authored May 14, 2024
1 parent 2e5df37 commit db66129
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/gather-buildtime-info.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ SPDX-License-Identifier: Apache-2.0
Copyright (c) OWASP Foundation. All Rights Reserved.
*/

const path = require('path')
const { execFileSync } = require('child_process')
const { constants: { MAX_LENGTH: BUFFER_MAX_LENGTH } } = require('buffer')
const { execFileSync } = require('child_process')
const fs = require('fs')
const path = require('path')
const { platform } = require('process')

const projectRootPath = path.resolve(__dirname, '..')
const targetFile = path.join(projectRootPath, 'src', 'buildtimeInfo.json')
Expand All @@ -34,7 +35,9 @@ function fromYarnInfo (pkgName) {
cwd: projectRootPath,
stdio: ['ignore', 'pipe', 'ignore'],
encoding: 'buffer',
maxBuffer: BUFFER_MAX_LENGTH
maxBuffer: BUFFER_MAX_LENGTH,
// windows requires a shell ...
shell: platform === 'win32'
}))

return {
Expand Down

0 comments on commit db66129

Please sign in to comment.