Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: Re: Implementation of simple newuser module (how to start?)



On Jul 26, 11:21am, Peter Stephenson wrote:
} Subject: Re: PATCH: Re: Implementation of simple newuser module (how to st
}
} Peter Stephenson wrote:
} > Bart Schaefer wrote:
} > >  autoload -U +X zsh-install-newuser && zsh-install-newuser
} > 
} > But autoload +X returns false if the function was already defined,
} > so it wouldn't execute the function in that case.
} 
} The following takes account of that.

Sorry, I forgot to respond to this thread yesterday ...

It was actually my intention that the function not be executed if it
is not the same function loaded by this module.  If the sysadmin has
gone to the trouble of defining a zsh-install-newuser [sic] then he
ought to run it himself, or be able to decide when it is run, without
this module jumping in.

However, I don't have any strong objection to what's in your patch.

} I've made the function a bit safer, so that if it gets run
} automatically it doesn't trash .zshrc.

You mean, if it gets run manually?

I'd have been tempted to setopt noclobber after the emulate ...



Messages sorted by: Reverse Date, Date, Thread, Author