From 921c0d804fd235ef19c3b191696425d7b55738e4 Mon Sep 17 00:00:00 2001 From: Michael Allen Date: Mon, 2 Mar 2015 00:20:44 +0000 Subject: add a sh file for calling the fetch I tried many ways to get the fetch call to background without staying attached to the current subshell. Ends up it's not possible to nohup or fully disown a function that is defined inside the same file that's calling it. So simple answer, I've created a file `fetch.sh` that can be called inside nohup. It will source `git-base.sh` and call the fetch function. --- fetch.sh | 3 +++ git-base.sh | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) create mode 100755 fetch.sh diff --git a/fetch.sh b/fetch.sh new file mode 100755 index 0000000..2bf3b45 --- /dev/null +++ b/fetch.sh @@ -0,0 +1,3 @@ +source $DOTFILES/zsh/git-prompt/git-base.sh + +fetch; diff --git a/git-base.sh b/git-base.sh index a4680c6..cf67198 100755 --- a/git-base.sh +++ b/git-base.sh @@ -86,10 +86,6 @@ time_to_update() { fi } -fetch_async() { - fetch & -} - fetch() { if time_to_update; then record_timestamp -- cgit v1.2.3