Skip to content

Gershwin add support for /Users and zsh#84

Merged
ericbsd merged 2 commits into
masterfrom
gershwin-admin-user-support
Jul 12, 2025
Merged

Gershwin add support for /Users and zsh#84
ericbsd merged 2 commits into
masterfrom
gershwin-admin-user-support

Conversation

@pkgdemon
Copy link
Copy Markdown
Contributor

@pkgdemon pkgdemon commented Jul 12, 2025

  • Adds support for creating new users in /Users when /Users id detected on livecd.
  • Makes the default shell zsh when /Users is detected on livecd which works better with Terminal.app.

Summary by Sourcery

Detect the presence of /Users on livecd environments and adapt user home directory paths and default shell selection accordingly

New Features:

  • Automatically detect /Users directory on livecd and create user home directories in /Users when present
  • Switch default shell to zsh when /Users directory is detected on livecd

@pkgdemon pkgdemon requested review from a team as code owners July 12, 2025 19:59
@pkgdemon pkgdemon self-assigned this Jul 12, 2025
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Jul 12, 2025

Reviewer's Guide

Introduce detection of macOS-style /Users directory on livecd and dynamically assign user home paths and default shell accordingly.

Class diagram for updated user creation logic in add_admin.py

classDiagram
    class AddAdmin {
        +save_selection()
        +__init__(button3)
        -sh: str
    }
    AddAdmin : +save_selection() now sets home folder to /Users/{uname} if /Users exists
    AddAdmin : +__init__() now sets default shell to zsh if /Users exists
Loading

File-Level Changes

Change Details Files
Conditional home directory path based on /Users presence
  • Added os.path.isdir('/Users') check
  • Constructed hf using '/Users/{uname}' when true, falling back to '/home/{uname}'
src/add_admin.py
Dynamic default shell selection for zsh support
  • Inserted os.path.isdir('/Users') branch around shell assignment
  • Set self.sh to '/usr/local/bin/zsh' when /Users exists; default back to fish otherwise
src/add_admin.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey @pkgdemon - I've reviewed your changes - here's some feedback:

  • Refactor the os.path.isdir('/Users') check into a single helper function or constant to avoid duplicating the livecd detection logic.
  • Make sure the default shells ('zsh' or 'fish') are actually included in the ComboBoxText options so the UI reflects the chosen default.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Refactor the os.path.isdir('/Users') check into a single helper function or constant to avoid duplicating the livecd detection logic.
- Make sure the default shells ('zsh' or 'fish') are actually included in the ComboBoxText options so the UI reflects the chosen default.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@ericbsd
Copy link
Copy Markdown
Contributor

ericbsd commented Jul 12, 2025

@pkgdemon, the more I think about it, we should make zsh the default for GhostBSD.

Copy link
Copy Markdown
Contributor

@ericbsd ericbsd left a comment

Choose a reason for hiding this comment

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

LGTM

@github-project-automation github-project-automation Bot moved this from In Review to In Progress in Development Tracker Jul 12, 2025
@ericbsd ericbsd merged commit d7d282b into master Jul 12, 2025
2 checks passed
@ericbsd ericbsd deleted the gershwin-admin-user-support branch July 12, 2025 20:03
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Development Tracker Jul 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants