diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2005-07-26 10:35:22 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2005-07-26 10:35:22 +0000 |
commit | 8534a97e9b33c9f5ceea9aa8e1408f9146bc4f68 (patch) | |
tree | 0470abd000275d9ce419ac1df8e7c4cf3f9947ea /Functions/Newuser/zsh-newuser-install | |
parent | 857c5983f8d460be85e380c1fd025dbb3a27b304 (diff) | |
download | zsh-8534a97e9b33c9f5ceea9aa8e1408f9146bc4f68.tar.gz zsh-8534a97e9b33c9f5ceea9aa8e1408f9146bc4f68.tar.xz zsh-8534a97e9b33c9f5ceea9aa8e1408f9146bc4f68.zip |
21527: rename zsh-newuser-install and don't run if not loaded
Diffstat (limited to 'Functions/Newuser/zsh-newuser-install')
-rw-r--r-- | Functions/Newuser/zsh-newuser-install | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Functions/Newuser/zsh-newuser-install b/Functions/Newuser/zsh-newuser-install new file mode 100644 index 000000000..6c54dc509 --- /dev/null +++ b/Functions/Newuser/zsh-newuser-install @@ -0,0 +1,23 @@ +# Function to install startup files for a new user. +# This dummy version simply creates a new .zshrc with a comment. +# FIXME: we don't want to distribute a file that does that, it +# would be preferable to do nothing at all. + +# Sanitize environment. +emulate -L zsh + +local zd=${ZDOTDIR:-$HOME} + +# The zsh/newuser module already tests for the following, so this test only +# triggers if zsh-newuser-install is run by hand. +# +# In future we may want to use this mechanism to update startup files. +if [[ -e $zd/.zshenv || -e $zd/.zprofile || -e $zd/.zshrc || -e $zs/.zlogin ]] +then + print "zsh-newuser-install: startup files exist, aborting" >&2 + return 1 +fi + +echo "# Created by newuser for $ZSH_VERSION" >$zd/.zshrc + +unfunction zsh-newuser-install |