-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Frameworks API cleanup #5737
Conversation
This pull request adds or modifies JavaScript ( |
export const preCleanup: CoreStep = { | ||
event: 'onPreBuild', | ||
coreStep, | ||
coreStepId: 'pre_cleanup', | ||
coreStepName: 'Pre cleanup', | ||
coreStepDescription: () => 'Cleaning up leftover files from previous builds', | ||
condition: blobsPresent, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means that this core step will now run for all builds as opposed to only running if there are blobs directories. That is fine, since calling rm()
on a directory that doesn't exist will not throw here, and we have a try/catch
around the calls anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🐳
const files = await new fdir() | ||
.withRelativePaths() // we want the relative path from the blobsDir | ||
.filter((fpath) => !path.basename(fpath).startsWith(METADATA_PREFIX)) | ||
.crawl(blobsDir) | ||
.withPromise() | ||
|
||
files.forEach((filePath) => { | ||
return files.map((filePath) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks ❤️
Summary
Follow-up to #5668 with some clean-up tasks:
deploy_config
directories toframeworks_api
.netlify/v1
directory before building to ensure we're not using leftover artefacts from a previous buildforEach
with amap