Skip to content

RunProgramError while running swiftly as the root user on macOS #346

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

Open
cmcgee1024 opened this issue May 8, 2025 · 0 comments
Open

RunProgramError while running swiftly as the root user on macOS #346

cmcgee1024 opened this issue May 8, 2025 · 0 comments

Comments

@cmcgee1024
Copy link
Member

When running swiftly init version 1.0.0 on macOS as the root user, there is the following error:

Error: RunProgramError(exitCode: 185, program: ".")

This is related to the following command that is run to detect the user's current shell:

"dscl", ".", "-read", FileManager.default.homeDirectoryForCurrentUser.path

That command fails with this error when run as root:

read: Invalid Path
<dscl_cmd> DS Error: -14009 (eDSUnknownNodeName)

When running as the root user, there will need to be some kind of fallback that doesn't error out the installation process. Also, the RunProgramError should report the correct program name (ie. not ".") for runProgramOutput().

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

No branches or pull requests

1 participant