Skip to content

Update flush-dns extension #18964

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Update flush-dns extension #18964

wants to merge 5 commits into from

Conversation

c0b41
Copy link

@c0b41 c0b41 commented May 5, 2025

Description

Screencast

Checklist

@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: flush-dns Issues related to the flush-dns extension labels May 5, 2025
@raycastbot
Copy link
Collaborator

raycastbot commented May 5, 2025

Thank you for your contribution! 🎉

🔔 @rasmusbe @tombonez you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

You can expect an initial review within five business days.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR updates the flush-dns extension to support Windows platform while modifying the DNS cache flushing functionality for both macOS and Windows operating systems.

  • Title in extensions/flush-dns/package.json should be "Flush DNS" (not "Flush Dns") since DNS is an acronym
  • The launchCommand in extensions/flush-dns/src/index.ts should be wrapped in a try-catch block
  • Consider using showFailureToast from @raycast/utils instead of custom error handling in handleExecutionError function
  • Recommend adding a subtitle "System" to the command in package.json for better context
  • Windows-specific error handling in handleExecutionError could be simplified by using showFailureToast

💡 (2/5) Greptile learns from your feedback when you react with 👍/👎!

2 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile

@@ -1,7 +1,7 @@
{
"$schema": "https://www.raycast.com/schemas/extension.json",
"name": "flush-dns",
"title": "Flush DNS",
"title": "Flush Dns",
Copy link
Contributor

Choose a reason for hiding this comment

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

style: 'Flush Dns' should be 'Flush DNS' since DNS is an acronym

Suggested change
"title": "Flush Dns",
"title": "Flush DNS",

switch (osPlatform) {
case "darwin":
{
const macResult = getMacOSCommands(osCommandSet);
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: getMacOSCommands is called without await but returns a Promise

Suggested change
const macResult = getMacOSCommands(osCommandSet);
const macResult = await getMacOSCommands(osCommandSet);

c0b41 and others added 2 commits May 5, 2025 16:45
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Copy link
Contributor

@rasmusbe rasmusbe left a comment

Choose a reason for hiding this comment

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

Great addition! I'm unable to try the Windows part it since I only own a mac, but it looks valid. 👏

I haven't verified that the mac parts still work, I will be able to do that on Thursday since I'm not having access to my development computer until then but I've added some small feedback based on what I see in the code.

"title": "Flush DNS",
"title": "Flush Dns",
Copy link
Contributor

Choose a reason for hiding this comment

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

'Flush Dns' should be 'Flush DNS' since DNS is an acronym

Copy link
Author

Choose a reason for hiding this comment

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

Linter was complaining, that why i changed

commands: {
ipconfig: "ipconfig /flushdns",
},
shell: undefined, // Uses cmd.exe by default
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be undefined or "cmd.exe" in that case. Feels like cmd.exe is making more sense, but I don't have a strong opinion regarding this.

Copy link
Author

Choose a reason for hiding this comment

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

raycast windows don't have showHUD api right so hard to know if throwing error, but Nodejs docs says right here node uses process.env.ComSpec as default shell as cmd.exe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension fix / improvement Label for PRs with extension's fix improvements extension: flush-dns Issues related to the flush-dns extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants