Pass R CMD check --as-cran
[valse.git] / initialize.sh
CommitLineData
f87ff0f5
BA
1#!/bin/sh
2
3#initialize submodules, set-up .git/config and .gitattributes, and pre-push hook
4git submodule init && git submodule update --merge
041e2ecf 5
7a56cc18
BA
6#filter for git-fat
7printf \
8'*.pdf filter=fat
9*.tar.xz filter=fat
10*.png filter=fat
11*.jpg filter=fat
12*.ps filter=fat\n' > .gitattributes
13
f87ff0f5
BA
14#filter for Jupyter
15python .nbstripout/nbstripout.py --install --attributes .gitattributes
041e2ecf 16
7a56cc18
BA
17#pre-commit and pre-push hooks: indentation, git fat push, submodules update
18cp hooks/* .git/hooks/
041e2ecf 19
7a56cc18
BA
20#install formatR
21echo 'if (! "formatR" %in% rownames(installed.packages()))
22 install.packages("formatR",repos="https://cloud.r-project.org")' | R --slave
041e2ecf 23
f87ff0f5
BA
24#.gitfat file with remote on gitfat@auder.net
25printf '[rsync]\nremote = gitfat@auder.net:~/files/valse\n' > .gitfat
041e2ecf 26
f87ff0f5 27#manual git-fat init: with relative path to binary
7a56cc18 28#1] remove filter if exists http://stackoverflow.com/a/12179641/4640434
f87ff0f5
BA
29sed -i '1N;$!N;s/\[filter "fat"\]\n.*\n.*//;P;D' .git/config
30#2] place new filter
7a56cc18
BA
31printf \
32'[filter "fat"]
33 clean = ./.git-fat/git-fat filter-clean
34 smudge = ./.git-fat/git-fat filter-smudge\n' >> .git/config