-
Notifications
You must be signed in to change notification settings - Fork 352
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
refactor: replace inherited logging, exit utils in commands.functions… #3347
Conversation
src/commands/functions/create.js
Outdated
@@ -243,7 +243,7 @@ const ensureFunctionDirExists = async function (context) { | |||
}) | |||
|
|||
log(`${NETLIFYDEVLOG} functions directory ${chalk.magenta.inverse(functionsDirHolder)} updated in site settings`) | |||
} catch (error) { | |||
} catch (_) { |
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.
} catch (_) { | |
} catch { |
src/commands/functions/create.js
Outdated
@@ -279,7 +279,7 @@ const downloadFromURL = async function (context, flags, args, functionsDir) { | |||
|
|||
try { | |||
mkdirRecursiveSync(fnFolder) | |||
} catch (error) { | |||
} catch (_) { |
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.
} catch (_) { | |
} catch { |
src/commands/functions/create.js
Outdated
@@ -365,7 +365,7 @@ const installDeps = async ({ functionPackageJson, functionPath, functionsDir }) | |||
const functionPackageLock = path.join(functionPath, 'package-lock.json') | |||
|
|||
fs.unlinkSync(functionPackageLock) | |||
} catch (error) { | |||
} catch (_) { |
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.
} catch (_) { | |
} catch { |
src/commands/functions/invoke.js
Outdated
@@ -270,7 +271,7 @@ const tryParseJSON = function (jsonString) { | |||
if (parsedValue && typeof parsedValue === 'object') { | |||
return parsedValue | |||
} | |||
} catch (error) {} | |||
} catch (_) {} |
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.
} catch (_) {} | |
} catch {} |
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 @tinfoil-knight, this looks great!
I just added a couple of small suggestions.
Hey @ehmicky, I've implemented the suggestions. Thanks for the review. The |
If you'd like to, sure! Netlify CLI supports only Node.js |
- Summary
#3028 was too large for review and is being broken down.
This PR is a follow-up on #3247 and uses the separate logging and process control utilities created in it to remove the inherited ones.
This PR focuses specifically on the src/commands/functions folder. Utilities outside this folder have been changed as less as possible to avoid growing the diff size in a single PR.
- Test plan
npx ava --verbose --serial
ran with 1 failing test:serving-functions
See: