2 # stamp the source with the originating git revision.
3 git_rev=$(git show --pretty'=oneline' 'HEAD' | head -n1 | cut -f1 -d' ')
4 #git_r='assign("git_revision","'$git_rev'",envir=.GlobalEnv)'
5 git_r=' global("git_revision","'$git_rev'")'
7 awk -v "git_r=$git_r" '
8 /# git_revision }/ {suppress=0}
10 /# git_revision {/ {print git_r; suppress=1}
11 ' <R/zzz.R >R/zzz.R.new && \
12 mv R/zzz.R.new R/zzz.R