Skip to content

Commit

Permalink
plugin.zsh: Use zsystem flock for compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
psprint committed Mar 20, 2017
1 parent c7e244e commit 1e242be
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions zconvey.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,31 @@ function zc-id() {
# flock in Zsh ver. < 5.3 doesn't) - util-linux/flock stripped
# of some things, compiles hopefully everywhere (tested on OS X,
# Linux, FreeBSD).
if [ ! -e "${ZCONVEY_REPO_DIR}/myflock/flock" ]; then
echo "\033[1;35m""psprint\033[0m/\033[1;33m""zconvey\033[0m is building small locking command for you..."
make -C "${ZCONVEY_REPO_DIR}/myflock"
if [[ ! -e "${ZCONVEY_REPO_DIR}/myflock/flock" ]]; then
(
if zmodload zsh/system; then
if zsystem flock -t 1 "${ZCONVEY_REPO_DIR}/myflock/flock.c"; then
echo "\033[1;35m""zdharma\033[0m/\033[1;33m""zconvey\033[0m is building small locking command for you..."
make -C "${ZCONVEY_REPO_DIR}/myflock"
fi
else
make -C "${ZCONVEY_REPO_DIR}/myflock"
fi
)
fi

# A command that feeds data to command line, via TIOCSTI ioctl
if [ ! -e "${ZCONVEY_REPO_DIR}/feeder/feeder" ]; then
echo "\033[1;35m""psprint\033[0m/\033[1;33m""zconvey\033[0m is building small command line feeder for you..."
make -C "${ZCONVEY_REPO_DIR}/feeder"
if [[ ! -e "${ZCONVEY_REPO_DIR}/feeder/feeder" ]]; then
(
if zmodload zsh/system; then
if zsystem flock -t 1 "${ZCONVEY_REPO_DIR}/myflock/flock.c"; then
echo "\033[1;35m""zdharma\033[0m/\033[1;33m""zconvey\033[0m is building small command line feeder for you..."
make -C "${ZCONVEY_REPO_DIR}/feeder"
fi
else
make -C "${ZCONVEY_REPO_DIR}/feeder"
fi
)
fi

#
Expand Down

0 comments on commit 1e242be

Please sign in to comment.