megabyte-labs / install.doctor

A glorious combination of application / theme settings and a performant cross-platform, desktop-oriented software suite.
https://megabyte.space
Other
102 stars 23 forks source link

Create new user / group on macOS and assign user to group #21

Closed ProfessorManhattan closed 1 year ago

ProfessorManhattan commented 1 year ago

❔ What are you experiencing an issue with?

Latest Release

❔ Version

Current

🐞 Description

Currently, it looks like the installer logic is successfully creating a system user and group with the following commands:

❯ sudo dscl . -create /Users/rclone
❯ sudo dscl . -create /Groups/rclone
❯ sudo dscl . -append /Groups/rclone GroupMembership rclone
❯ id -Gn rclone
id: β€˜rclone’: no such user: Invalid argument
❯ dscacheutil -q group -a name rclone
❯ echo $?
0

However, the logic needs to be fixed so that the rclone user is added to the rclone system group. Then, there should be logic that adds the $USER to the rclone group as well.

If you know how to do this, you can just post it right here and I will implement it. Thanks.

⏺️ Steps To Reproduce

No response

πŸ“’ Relevant Log Output

No response

πŸ’‘ Possible Solution

No response

ProfessorManhattan commented 1 year ago

Fixed this. Logic for future reference is in home/.chezmoiscripts/universal/run_onchange_before_20-ensure-user-group.sh.tmpl