summaryrefslogtreecommitdiff
path: root/include/bootstrap
blob: 658735f77259473a81e46224fcc63e2e64e62e2a (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
#!/usr/bin/env zsh
# bootstrap - populate a home with the most necessary scripts
# After running this, other packages can be installed using 'pkg'

typeset -i rcempty=0

# zsh keeps complaining about not having a configuration,
# so let's be kind and give it an empty one.
if ! [[ -e ~/.zshrc ]] {
	rcempty=1
	touch ~/.zshrc
}

# Make basic dirctories
mkdir -p ~/bin
mkdir -p ~/packages/.collected/man/man{1..8}

if ! which git &> /dev/null; then
	echo "git not found. Sorry."
	exit 200
fi

cd ~/packages
echo "fetching core..."
git clone ssh://derf.homelinux.org/var/packages_root/core

cd core
bin/checklinks
bin/pkg eval populate_collected core
bin/pkg eval exec_hook core post-add

(( rcempty )) && rm ~/.zshrc