Make note of prepend, silence error
If a file doesn't exist, "$(<nonexistent)" will write: zsh: no such file or directory: nonexistent to fd 2. Wrap this with a "() 2>/dev/null" to silence these outputs.
This commit is contained in:
parent
0f5ceab00a
commit
fbb748252a
@ -45,12 +45,12 @@ uninstall those first to prevent conflicts.
|
|||||||
git clone --recursive https://github.com/Eriner/zim.git ${ZDOTDIR:-${HOME}}/.zim
|
git clone --recursive https://github.com/Eriner/zim.git ${ZDOTDIR:-${HOME}}/.zim
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Paste this into your terminal to copy the template configuration files (or append to existing configs):
|
2. Paste this into your terminal to prepend the initialization templates to your configs:
|
||||||
```
|
```
|
||||||
setopt EXTENDED_GLOB
|
setopt EXTENDED_GLOB
|
||||||
for template_file ( ${ZDOTDIR:-${HOME}}/.zim/templates/* ); do
|
for template_file ( ${ZDOTDIR:-${HOME}}/.zim/templates/* ); do
|
||||||
user_file="${ZDOTDIR:-${HOME}}/.${${template_file}:t}"
|
user_file="${ZDOTDIR:-${HOME}}/.${${template_file}:t}"
|
||||||
print -n "$(<${template_file})\n$(<${user_file})" >! ${user_file}
|
( print -n "$(<${template_file})\n$(<${user_file})" >! ${user_file} ) 2>/dev/null
|
||||||
done
|
done
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user