forked from ivoarch/.dot-org-files
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·54 lines (44 loc) · 1.06 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
function clone_repo() {
DOT_ORG_DIR=$HOME/.dot-org-files
if [ -e $DOT_ORG_DIR ] ; then
echo "Updating .dot-org-files..."
cd $DOT_ORG_DIR
git pull
else
echo "Cloning .dot-org-files..."
git clone https://github.com/ivoarch/.dot-org-files.git $DOT_ORG_DIR
cd $DOT_ORG_DIR
fi
}
#function install_deps() {
# echo "Installing depends..."
# makepkg --syncdeps --clean
# rm -rf .dot-org-files
#}
function tangle_files() {
echo "Tangle config files with org-mode..."
DIR=`pwd`
FILES=""
# wrap each argument in the code required to call tangle on it
#for i in $@; do
for i in `ls | grep \.org`; do
FILES="$FILES \"$i\""
done
emacs -Q --batch \
--eval \
"(progn
(require 'org)(require 'ob)(require 'ob-tangle)
(mapc (lambda (file)
(find-file (expand-file-name file \"$DIR\"))
(org-babel-tangle)
(kill-buffer)) '($FILES)))"
#2>&1 | grep Tangled
}
# Clone repo
clone_repo
# Install depends
#install_deps
# tangle config files
tangle_files
exit 0