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

chore: Reorganize and clean #92

Merged
merged 2 commits into from
Jan 28, 2025
Merged

chore: Reorganize and clean #92

merged 2 commits into from
Jan 28, 2025

Conversation

martimlobao
Copy link
Owner

@martimlobao martimlobao commented Jan 28, 2025

  • move computer name function from macos.sh to local.sh since it uses 1Password
  • print serial and model
  • tweak print messages

Summary by Sourcery

Move the computer name function from macos.sh to local.sh, print the serial and model of the computer, and update print messages.

New Features:

  • Allow users to set the computer name via 1Password.

Enhancements:

  • Move the computer naming logic to local.sh to utilize 1Password for name management.

Chores:

  • Print the computer's serial and model during setup.

- move computer name function from macos.sh to local.sh since it uses 1Password
- print serial and model
- tweak print messages
Copy link

trunk-io bot commented Jan 28, 2025

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

Copy link
Contributor

sourcery-ai bot commented Jan 28, 2025

Reviewer's Guide by Sourcery

This pull request reorganizes the scripts, moving the computer name function to local.sh, and adds printing of serial and model information. It also tweaks some print messages for clarity.

Sequence diagram for computer name setting process

sequenceDiagram
    participant User
    participant Script
    participant System
    participant 1Password

    Script->>System: Get hardware UUID, serial, model
    Script->>1Password: Look up computer name
    alt Name not found
        Script->>User: Prompt for computer name
        User->>Script: Provide name
        Script->>1Password: Save name, serial, model
    end
    Script->>System: Get current computer name
    alt Name different from current
        Script->>System: Set computer name
        Script->>System: Set NetBIOS name
        Script->>System: Set LocalHostName
        Script->>System: Set HostName
    end
Loading

Flow diagram for script organization changes

flowchart TB
    subgraph Before
        macos[macos.sh]
        macos -->|contains| computer[Computer Name Function]
    end
    subgraph After
        local[local.sh]
        local -->|contains| computer2[Computer Name Function]
        local -->|uses| op[1Password]
    end
    Before -->|moved to| After
Loading

File-Level Changes

Change Details Files
Move computer name function to local.sh
  • Moved the set_computer_name function from macos.sh to local.sh.
  • Removed the set_computer_name function from macos.sh.
local.sh
macos.sh
Print serial and model information
  • Added logic to retrieve and print the serial number in run.sh.
  • Added logic to retrieve and print the model in run.sh.
  • Added logic to save serial and model to 1Password in local.sh.
local.sh
run.sh
Tweak print messages
  • Updated the inject message to show the output path relative to the home directory in local.sh.
  • Updated the copy message to show the output path relative to the home directory in local.sh.
  • Updated the link message to show the output path relative to the home directory in dotsync.sh.
local.sh
dotsync.sh

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!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

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
Contributor

@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 @martimlobao - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟡 Security: 1 issue found
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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.

dotsync.sh Outdated Show resolved Hide resolved
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@martimlobao martimlobao merged commit 1b47241 into main Jan 28, 2025
7 checks passed
@martimlobao martimlobao deleted the chore/move-to-local branch January 28, 2025 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant