replace got with axios, and add macOS sign support with pr #1049
This commit is contained in:
@@ -1,17 +1,22 @@
|
||||
const { mkdtemp, copyFile } = require('fs/promises')
|
||||
const { mkdtemp, copyFile, realpath } = require('fs/promises')
|
||||
const os = require('os')
|
||||
const path = require('path')
|
||||
const rimraf = require('rimraf')
|
||||
const cp = require('child_process')
|
||||
|
||||
async function runTests() {
|
||||
const tempdir = await mkdtemp(path.join(os.tmpdir(), 'nexe-integration-tests-'))
|
||||
const tempdir = await realpath(await mkdtemp(path.join(os.tmpdir(), 'nexe-integration-tests-')))
|
||||
const secondTempdir = await mkdtemp(path.join(os.tmpdir(), 'nexe-integration-tests-without-executable-'))
|
||||
const executable = path.join(tempdir, path.basename(process.argv[0]))
|
||||
await copyFile(process.argv[0], executable)
|
||||
process.on('beforeExit', () => {
|
||||
rimraf.sync(tempdir)
|
||||
rimraf.sync(secondTempdir)
|
||||
try {
|
||||
rimraf.sync(tempdir)
|
||||
rimraf.sync(secondTempdir)
|
||||
} catch(e) {
|
||||
console.error(`Ignoring error during integration test cleanup of "${tempdir}".`)
|
||||
console.error(`Error: ${e}`)
|
||||
}
|
||||
})
|
||||
console.error('Running integration tests with the binary in the current working directory.')
|
||||
spawnExecutable(tempdir, () => {
|
||||
|
||||
Reference in New Issue
Block a user