-
Notifications
You must be signed in to change notification settings - Fork 95
ci: set check_latest to true #363
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| const { join } = require('path') | ||
|
|
||
| const findCacheDir = require('find-cache-dir') | ||
| const { existsSync, readdirSync, readFileSync, rmdirSync, removeSync, writeFileSync } = require('fs-extra') | ||
| const { existsSync, readdirSync, readFileSync, removeSync, writeFileSync } = require('fs-extra') | ||
|
|
||
| const { NETLIFY_PUBLISH_PATH, NETLIFY_FUNCTIONS_PATH } = require('../config') | ||
|
|
||
|
|
@@ -22,15 +22,13 @@ const handleFileTracking = ({ functionsPath, publishPath }) => { | |
| const trackingFile = readFileSync(trackingFilePath, 'utf8') | ||
| const [trackedFunctions, trackedPublish] = trackingFile.split(TRACKING_FILE_SEPARATOR) | ||
| const cleanConfiguredFiles = (trackedFiles, dirPath) => { | ||
| trackedFiles.forEach((file) => { | ||
| const filePath = join(dirPath, file.trim('\r')) | ||
| if (file !== '') { | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure but the intention here might be to check the trimmed version of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. trackingFile.split would sometimes insert '' into trackedFiles; this is just to skip that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in these cases, with file === '', it removes the current dir |
||
| if (process.platform === 'win32') { | ||
| rmdirSync(filePath, { recursive: true }) | ||
| } | ||
| trackedFiles | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lindsaylevine can you approve this change? |
||
| .map((file) => file.trim()) | ||
| .filter(Boolean) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this effectively the same thing as
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the original code |
||
| .forEach((file) => { | ||
| const filePath = join(dirPath, file) | ||
| removeSync(filePath) | ||
| } | ||
| }) | ||
| }) | ||
| } | ||
|
|
||
| if (isConfiguredPublishDir) { | ||
|
|
||
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.
Not sure I understand the original code.
trimdoesn't accept an argument. Alsorecursive: trueis not supported for Node.js 10.Finally I'm not sure why we need
rmdirSyncon Windows since removeSync does the same without failing on non existent files.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.
basically this work was trial and error on windows when i first did it. it was just to get a bandaid solution out so plugin users could even SORTOF use the CLI, in lieu of a CLI-based solution like having plugins build into a sep dir (instead of changing their src). if all the tests pass still with this diff then thats great!!
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.
Sorry I should have been more clear.
trim('\r')is the same astrim()astrimdoesn't accept an argument.