Skip to content
This repository was archived by the owner on Aug 9, 2021. It is now read-only.

Commit d304ab6

Browse files
committed
Fix await on fsExist
1 parent c0e934e commit d304ab6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

npm/src/setup.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ const fsExist = util.promisify(fs.exists);
1010

1111
async function setupQode() {
1212
const { extractDir, cacheDir, downloadLink } = config;
13-
if (fsExist(config.qodePath)) {
13+
if (await fsExist(config.qodePath)) {
14+
console.log(`Qode binary exists at ${config.qodePath}, skipping setup.`);
1415
return extractDir;
1516
}
1617
const archivePath = path.resolve(cacheDir, path.basename(downloadLink));
1718
await mkdirp(extractDir);
1819
await download(downloadLink, archivePath, true);
1920
await extract(archivePath, extractDir);
21+
fs.chmodSync(config.qodePath, 0o775);
2022
console.log(`Qode was setup successfully at : ${extractDir}`);
2123
return extractDir;
2224
}

0 commit comments

Comments
 (0)