From 00a4ff0171b751f8c000541dc352d1b28ba68470 Mon Sep 17 00:00:00 2001 From: Vijay Ramamurthy Date: Mon, 12 Jul 2021 08:53:01 -0500 Subject: [PATCH] use fs instead of fs/promises for compatibility with older vscode versions --- lib/flowLSP/utils/getVerifiedFlowBinPath.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/flowLSP/utils/getVerifiedFlowBinPath.js b/lib/flowLSP/utils/getVerifiedFlowBinPath.js index fb42427..aabb638 100644 --- a/lib/flowLSP/utils/getVerifiedFlowBinPath.js +++ b/lib/flowLSP/utils/getVerifiedFlowBinPath.js @@ -2,14 +2,16 @@ import Logger from './Logger'; import importFresh from './importFresh'; import getExtensionPath from './getExtentionPath'; -// $FlowFixMe Flow doesn't recognize the fs/promises node module -import { readFile, readdir, access } from 'fs/promises'; +import { promises } from 'fs'; import { createReadStream } from 'fs'; import path from 'path'; // $FlowFixMe Flow doesn't recognize crypto.verify import { verify, createHash } from 'crypto'; import { window } from 'vscode'; +// fs/promises +const { readFile, readdir, access } = promises; + function getFlowBinDirPrefixForPlatform(): null | string { return process.platform === 'darwin' ? 'flow-osx-v' : @@ -44,7 +46,7 @@ async function getShasums(flowBinModulePath: string, logger: Logger): Promise