Skip to content

Commit

Permalink
Merge pull request #80 from sigma/master
Browse files Browse the repository at this point in the history
bookmark: support CLOBBER
  • Loading branch information
willghatch committed Mar 9, 2016
2 parents e1aefc8 + 2297329 commit d0fdc53
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sources/bookmark.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function zaw-bookmark-execute() {
function zaw-bookmark-add() {
local -a bookmarks

: >> "${BOOKMARKFILE}"
: >>| "${BOOKMARKFILE}"
(
if zsystem flock -t 5 "${BOOKMARKFILE}"; then
bookmarks=("${(f)$(< "${BOOKMARKFILE}")}" "${(q@)@}")
Expand All @@ -44,7 +44,7 @@ function zaw-bookmark-add() {
bookmarks=("${(@)bookmarks:#}")

# remove duplicated lines, sort and write to ${BOOKMARKFILE}
print -rl -- "${(@un)bookmarks}" > "${BOOKMARKFILE}"
print -rl -- "${(@un)bookmarks}" >| "${BOOKMARKFILE}"
else
print "can't acquire lock for '${BOOKMARKFILE}'" >&2
exit 1
Expand All @@ -66,7 +66,7 @@ function zaw-bookmark-remove() {
local s
local -a bookmarks

: >> "${BOOKMARKFILE}"
: >>| "${BOOKMARKFILE}"
(
if zsystem flock -t 5 "${BOOKMARKFILE}"; then
bookmarks=("${(f)$(< "${BOOKMARKFILE}")}")
Expand All @@ -75,7 +75,7 @@ function zaw-bookmark-remove() {
done

# remove duplicated lines, sort and write to ${BOOKMARKFILE}
print -rl -- "${(@un)bookmarks}" > "${BOOKMARKFILE}"
print -rl -- "${(@un)bookmarks}" >| "${BOOKMARKFILE}"
else
print "can't acquire lock for '${BOOKMARKFILE}'" >&2
exit 1
Expand Down

0 comments on commit d0fdc53

Please sign in to comment.