Skip to content

Commit

Permalink
Make build-ScriptDetection sync
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Jan 21, 2020
1 parent b81fb63 commit 31ddf96
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/build-storybooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ const {
readFile: readFileRaw,
writeFile: writeFileRaw,
statSync,
readFileSync,
} = require('fs');
const { join } = require('path');

const readdir = promisify(readdirRaw);
const readFile = promisify(readFileRaw);
const writeFile = promisify(writeFileRaw);

const p = l => join(__dirname, '..', ...l);
Expand All @@ -35,8 +35,8 @@ const exec = async (command, args = [], options = {}) =>
});
});

const hasBuildScript = async l => {
const text = await readFile(l, 'utf8');
const hasBuildScript = l => {
const text = readFileSync(l, 'utf8');
const json = JSON.parse(text);

return !!json.scripts['build-storybook'];
Expand Down Expand Up @@ -123,7 +123,7 @@ const handleExamples = async files => {
try {
stats = statSync(packageJsonLocation);
} catch (e) {
//
// the folder had no package.json, we'll ignore
}

return stats && stats.isFile() && hasBuildScript(packageJsonLocation);
Expand Down

0 comments on commit 31ddf96

Please sign in to comment.