-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: run node-gyp rebuild correctly (#409)
* fix(module-rebuilder): iterate through all of the node-gyp commands * fix(module-rebuilder): set node-gyp's working directory to the module being rebuilt & improve errors * test: add test to ensure that the module actually got rebuilt * build(ci): set GYP_MSVS_VERSION in CircleCI * fix(rebuilder): cache the MSVS version when the rebuilder is created * test: reset MSVS version after rebuild tests
- Loading branch information
Showing
6 changed files
with
76 additions
and
9 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
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,21 @@ | ||
import * as crypto from 'crypto'; | ||
import * as fs from 'fs-extra'; | ||
import { promisify } from 'util'; | ||
import * as stream from 'stream'; | ||
|
||
const pipeline = promisify(stream.pipeline); | ||
|
||
export async function determineChecksum(filename: string): Promise<string> { | ||
let calculated = ''; | ||
const file = fs.createReadStream(filename, { encoding: 'binary' }); | ||
const hasher = crypto.createHash('sha256', { defaultEncoding: 'binary' }); | ||
hasher.on('readable', () => { | ||
const data = hasher.read(); | ||
if (data) { | ||
calculated = data.toString('hex'); | ||
} | ||
}); | ||
await pipeline(file, hasher); | ||
|
||
return calculated; | ||
} |
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