1
0
Fork 0
mirror of synced 2024-12-22 22:18:57 -05:00
zimfw/modules/git/functions/git-ignore-add
Eric Nielsen d371d80af2
Unify the for syntax
For short single commands, prefer a one-liner `for` with the zsh syntax:
```
for x (foo bar) print ${x}
```
Otherwise just place `; do` on the same line as the POSIX `for ... in`:
```
for x in foo bar; do
  print ${x}
done
```

Closes #268
2018-04-25 08:59:19 -05:00

6 lines
194 B
Bash

# vim:et sts=2 sw=2 ft=zsh
local git_root
git_root=$(git-root) || return 1
# we are in a git repository. add parameters to .gitignore
for file (${@}) print ${file} >>! "${git_root}/.gitignore"