-
-
Notifications
You must be signed in to change notification settings - Fork 532
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
25 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Written in JS to support Windows | ||
// Would otherwise be written as inline bash in package.json script | ||
|
||
const { exec } = require('child_process') | ||
const { mkdtempSync, writeFileSync, readFileSync, unlinkSync, rmdirSync, readdirSync } = require('fs') | ||
const { join } = require('path') | ||
|
||
const testDir = join(__dirname, '../tests') | ||
const tarballPath = join(testDir, 'ts-node-packed.tgz') | ||
const tempDir = mkdtempSync(join(testDir, 'tmp')) | ||
exec(`npm pack "${join(__dirname, '..')}"`, { cwd: tempDir }, (err, stdout) => { | ||
if (err) { | ||
console.error(err) | ||
process.exit(1) | ||
} | ||
const tempTarballPath = join(tempDir, readdirSync(tempDir)[0]) | ||
writeFileSync(tarballPath, readFileSync(tempTarballPath)) | ||
unlinkSync(tempTarballPath) | ||
rmdirSync(tempDir) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters