|
2 | 2 | import Logger from './Logger'; |
3 | 3 | import importFresh from './importFresh'; |
4 | 4 | import getExtensionPath from './getExtentionPath'; |
5 | | -// $FlowFixMe Flow doesn't recognize the fs/promises node module |
6 | | -import { readFile, readdir, access } from 'fs/promises'; |
| 5 | +import { promises } from 'fs'; |
7 | 6 | import { createReadStream } from 'fs'; |
8 | 7 | import path from 'path'; |
9 | 8 | // $FlowFixMe Flow doesn't recognize crypto.verify |
10 | 9 | import { verify, createHash } from 'crypto'; |
11 | 10 | import { window } from 'vscode'; |
12 | 11 |
|
| 12 | +// fs/promises |
| 13 | +const { readFile, readdir, access } = promises; |
| 14 | + |
13 | 15 | function getFlowBinDirPrefixForPlatform(): null | string { |
14 | 16 | return process.platform === 'darwin' |
15 | 17 | ? 'flow-osx-v' : |
@@ -44,7 +46,7 @@ async function getShasums(flowBinModulePath: string, logger: Logger): Promise<Bu |
44 | 46 | try { |
45 | 47 | // try veryifying against SHASUM256.txt.sign |
46 | 48 | const shasums = await readFile(path.join(flowBinModulePath, 'SHASUM256.txt')); |
47 | | - const shasumsSignatureBase64 = await readFile(path.join(flowBinModulePath, 'SHASUM256.txt.sign'), { encoding: 'ascii' }); |
| 49 | + const shasumsSignatureBase64 = await readFile(path.join(flowBinModulePath, 'SHASUM256.txt.sign'), 'ascii' ); |
48 | 50 | const shasumsSignature = Buffer.from(shasumsSignatureBase64, 'base64'); |
49 | 51 | const publicKey = await readFile(path.join(extensionPath, 'signing.pem')); |
50 | 52 | if (!verify('sha256', shasums, publicKey, shasumsSignature)) { |
|
0 commit comments