mattly / bork

the Bash-Operated Reconciling Kludge
Other
218 stars 29 forks source link

add loginshell type #84

Open edrex opened 7 years ago

edrex commented 7 years ago

satisfies that the current user's login shell is set to some value

edrex commented 7 years ago

thinking it would be nice if this added the entry to /etc/shells if it isn't already there (maybe just add https://github.com/mattly/dotfiles/blob/master/bork/types/shells.sh as well)

edrex commented 7 years ago

Proposal: combine types/shells.sh from mattly/dotfiles with this, a single type with an optional second argument to set as current user shell:

ok shell /usr/local/bin/zsh login

With this form it would both ensure there is a line in /etc/shells and that the current user shell is set to it. Without the optional login param it would just check /etc/shells.

@mattly wdyt?

mattly commented 7 years ago

The code here looks good. Pursuant to the discussion about merging with the shell type from my dotfiles, I'm inclined to agree that merging this into that as an option is probably the best path. I've been meaning to write tests for that and merge it here, but thanks to :baby: I haven't even been keeping my dotfiles in sync these days.

The reasoning behind merging this to shell is that a) it's only for the current user, b) that's probably the 90% use case one might expect from this, and c) while we could add an option to specify the user for whom this is for, the users type has its own option to specify a user's shell (I found some resources on programmatically creating users on Darwin, hopefully I can add that).

I'd like to say I'll be able to take a stab at merging them this week/end, but I've been telling myself I'll look at these PRs "really soon" for six weeks now, so... If you want to take a stab at it, let me know and I'll leave it to you, otherwise I'll do it when I can. It shouldn't be too hard.