-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·39 lines (32 loc) · 1.04 KB
/
install
File metadata and controls
executable file
·39 lines (32 loc) · 1.04 KB
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
#!/bin/bash
dest_dir=~/.local/bin
blade_dir=$(cd $(dirname $0) && pwd)
cd $blade_dir
echo -n "Installing vim scripts..."
mkdir -p ~/.vim/{syntax,ftdetect,indent}
ln -sf $blade_dir/vim/ftdetect/blade.vim ~/.vim/ftdetect/
ln -sf $blade_dir/vim/syntax/blade.vim ~/.vim/syntax/
ln -sf $blade_dir/vim/indent/blade.vim ~/.vim/indent/
if [ ! -f ~/.vimrc ]; then
touch ~/.vimrc
fi
if ! grep "set filetype=blade" ~/.vimrc 2>&1 >/dev/null; then
cat >> ~/.vimrc << END
augroup filetype
autocmd! BufRead,BufNewFile BUILD set filetype=blade
augroup end
END
fi
echo ", Done."
mkdir -p $dest_dir
echo -n "Installing blade auxiliary tools..."
ln -sf $blade_dir/{genlibbuild,lsnobuild,lsrc,bladefunctions} $dest_dir
if [ ! -f ~/.bashrc ] || ! grep "bladefunctions" ~/.bashrc 2>&1 >/dev/null; then
echo "##### BLADE INSTALL #####" >> ~/.bashrc
echo "test -s $dest_dir/bladefunctions && . $dest_dir/bladefunctions || true" >> ~/.bashrc
fi
echo ", Done."
echo -n "Installing blade..."
ln -sf $blade_dir/blade $dest_dir
echo ", Done."
echo "All successful."