Take default shell from config and $SHELL #2

Merged
mars merged 3 commits from lilithium-hydride/piss:main into main 2022-10-09 03:01:59 +00:00
Contributor

Force-feeding fish to unsuspecting users is cruel and unusual. piss should now check the config file for a path to a shell. If the shell path in the config is empty, it will use $SHELL on Unix-y systems and C:\Windows\System32\cmd.exe on windows systems.

Force-feeding `fish` to unsuspecting users is cruel and unusual. piss should now check the config file for a path to a shell. If the shell path in the config is empty, it will use `$SHELL` on Unix-y systems and `C:\Windows\System32\cmd.exe` on windows systems.
lilithium-hydride added 2 commits 2022-10-09 02:50:29 +00:00
mars reviewed 2022-10-09 02:55:27 +00:00
@ -45,0 +49,4 @@
match std::env::consts::OS {
"windows" => r#"C:\Windows\System32\cmd.exe"#.to_string(),
"linux" | "openbsd" | "netbsd" | "dragonfly" | "solaris" | "macos" | _ =>
std::env::var("SHELL").unwrap_or("/bin/sh".to_string())
Owner

Can you move the catch-all _ case to another branch, to panic with an unimplemented!("Unreognized operating system; cannot get user's shell")?

Can you move the catch-all `_` case to another branch, to panic with an `unimplemented!("Unreognized operating system; cannot get user's shell")`?
lilithium-hydride marked this conversation as resolved
lilithium-hydride added 1 commit 2022-10-09 02:57:59 +00:00
Owner

Wonderful, thank you. :) I especially like the new SystemConfig section. That'll definitely come in handy.

Wonderful, thank you. :) I especially like the new `SystemConfig` section. That'll definitely come in handy.
mars merged commit f113ee79bf into main 2022-10-09 03:01:59 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mars/piss#2
No description provided.