Skip to content

Conversation

@cpcallen
Copy link
Collaborator

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide

The details

Proposed Changes

Behavior Before Change

  • Build depends on existence of mkdir -p command.
  • npm test will fail if npm run clean (or npm run clean:build) isn't run first.

Behavior After Change

  • Tests succeed even if build directory not cleaned first.

cpcallen added 2 commits July 10, 2021 13:13
Also consistently use {recursive: true} in case directory is nested
in an also-not-yet-existent directory.
npm test has been failing if previous build output was present,
because the generated build/msg/??.msg files are missing a trailing
newline and the line to exclude build/* from being linted was
inadvertently omitted from commit 9e72378.

(Much of the rest of the build output would also fail lint checks but
was already excluded by the *_compressed*.js exclusion.)
*/
function buildLangfiles(done) {
// Create output directory.
// TODO(#5000): does mkidr -p work on Windows?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this comment since you've now checked.

}
fs.mkdirSync(demoStaticTmpDir, { recursive: true });
done()
fs.mkdir(demoStaticTmpDir, {recursive: true});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should still be mkdirSync

An intermediate version of this code read:

    fs.mkdir(demoStaticTmpDir, {recursive: true}), done);

but apparently `fs.mkdir` doesn't honour the recursive option, so I
tried to revert the change but munged it instead.

This commit cleans up the mess I made.
No more `execSync('mkdir -p')` so no more need to check if it works on
Windows.
@cpcallen cpcallen removed the request for review from NeilFraser July 13, 2021 15:11
@cpcallen cpcallen merged commit c42c5e7 into RaspberryPiFoundation:develop Jul 13, 2021
@cpcallen cpcallen deleted the build-cleanup branch July 13, 2021 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants