Skip to content
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

Fix: --host flag logs when no network IPs are found #3547

Merged
merged 3 commits into from
Jun 7, 2022

Conversation

bholmesdev
Copy link
Contributor

Changes

Testing

None added, since testing would require stubbing Node's os package to return an empty array. I attempted to use Sinon for this, and discovered it can't support ESM 😢 Would love to improve our testing infra for cases like this!

Docs

N/A

@changeset-bot
Copy link

changeset-bot bot commented Jun 7, 2022

🦋 Changeset detected

Latest commit: 93b94dc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
astro Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jun 7, 2022
@bholmesdev bholmesdev changed the title Fix/host flag server logs Fix: --host flag logs when no network IPs are found Jun 7, 2022
Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

LGTM!

if (networkLogging === 'host-to-expose') {
network = `${networkPrefix}${dim('use --host to expose')}`;
} else if (networkLogging === 'visible') {
const ipv4Networks = Object.values(os.networkInterfaces())
Copy link
Contributor

Choose a reason for hiding this comment

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

wow, fancy

Copy link
Contributor

@matthewp matthewp left a comment

Choose a reason for hiding this comment

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

lgtm

@bholmesdev bholmesdev merged commit a83d581 into main Jun 7, 2022
@bholmesdev bholmesdev deleted the fix/host-flag-server-logs branch June 7, 2022 21:12
@github-actions github-actions bot mentioned this pull request Jun 7, 2022
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
* feat: add fallback log if no network interfaces found

* fix: extra newline on missing network log

* chore: changeset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 BUG: Astro gives different CLI output with no --host flag and --host flag
3 participants