Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions files-watcher/files-watcher
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ report_done() {
[[ $# > 0 ]] && echo "${FCG}✓ $@${NC}" || echo "${FCG}✓ Done${NC}"
}

run_command() {
local previous_ifs=${IFS}
IFS=' '
command $@
IFS=${previous_ifs}
}

main() {
watch_branches=$(git config --default master --get files-watcher.watch-branches)
default_mode=$(git config --default prompt --get files-watcher.mode)
Expand Down Expand Up @@ -141,16 +148,16 @@ main() {
for command in ${commands} ; do
case "${mode}" in
"auto" )
command ${command}
run_command "${command}"
;;
"prompt" )
if prompt "Do you like to run '${command}'?"; then
command ${command}
run_command "${command}"
fi
;;
"confirm" )
if confirm "Do you like to run '${command}'?"; then
command ${command}
run_command "${command}"
fi
;;
* )
Expand Down