blob: c7fa3aa753f4e6c618f9131f638addee50a8170b (
plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
#!/usr/bin/env bash
dependencies=(
"Config::Simple"
"Data::Printer"
"inc::Module::Install"
"Data::MessagePack"
"File::Path"
"Net::MPD"
)
printf "%s\n" "This script will install needed cpan modules"
printf "%s\n" "and copy configs to $HOME/.config/clerk"
read -e -p "Proceed? (Y/n) > " go_on
go_on=${go_on:-y}
case $go_on in
n) exit;
;;
esac
read -e -p "Configure cpanp to install modules via pacman? (Y/n) > " cpan_arch
cpan_arch=${cpan_arch:-y}
case $cpan_arch in
y) if [[ -z $(pacman -Qsq perl-cpanplus-dist-arch) ]]
then
read -e -p "perl-cpanplus-dist-arch package not found. Install? (Y/n) > " cpanp_dist_install
cpanp_dist_install=${cpanp_dist_install:-y}
case $cpanp_dist_install in
y) yes | sudo pacman -S perl-cpanplus-dist-arch
;;
esac
fi
setupdistarch;
esac
read -e -p "Install dependencies for clerk? (Y/n) > " deps_choice
deps_choice=${deps_choice:-y}
case "${deps_choice}" in
y)
for dep in "${dependencies[@]}"
do
cpanp i "${dep}"
done
sudo pacman -S perl-config-simple perl-http-date perl-ipc-run
;;
esac
read -e -p "Set installation directory. (Default: $HOME/bin) > " foo
foo=${foo:-$HOME/bin}
case $foo in
y) export path="$HOME/bin";
;;
*) export path="$foo";
;;
esac
read -e -p "Install clerk to $path? (Y/n) > " install
install=${install:-y}
case $install in
y) cp clerk $path;
if [[ ! -d "${HOME}/.config/clerk" ]]
then
mkdir "${HOME}/.config/clerk"
fi
cp clerk.tmux clerk.conf "${HOME}/.config/clerk"
sed -i "s@PLACEHOLDER@"$HOME"@" "${HOME}/.config/clerk/clerk.conf"
;;
*) exit;
esac
|