Skip to content

Conversation

@bcotrim
Copy link
Contributor

@bcotrim bcotrim commented Dec 24, 2025

Related issues

Proposed Changes

  • Add updateDomainInHosts() function to cli/lib/hosts-file.ts that handles removing the old domain and adding the new domain in a single hosts file write operation (single admin privilege request)
  • Add skipHostsUpdate option to setupCustomDomain() in cli/lib/site-utils.ts to avoid duplicate hosts file updates
  • Refactor cli/commands/site/set-domain.ts to use the new combined operation

Testing Instructions

  1. Create a site with no custom domain
  2. Run studio site set-domain test.local --path <site-path>
    • Verify you're only prompted for admin password once
    • Verify the domain is added to /etc/hosts
  3. Run studio site set-domain test2.local --path <site-path> to change the domain
    • Verify you're only prompted for admin password once (previously this asked twice)
    • Verify test.local is removed and test2.local is added to /etc/hosts
  4. Run unit tests: npm test -- cli/commands/site/tests/set-domain.test.ts

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@bcotrim bcotrim self-assigned this Dec 24, 2025
@bcotrim bcotrim changed the base branch from trunk to dev/studio-cli-i2 December 24, 2025 17:01
@bcotrim bcotrim requested review from a team and fredrikekelund December 24, 2025 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants