Skip to content

Commit af6adcd

Browse files
committed
simplified setup
1 parent 70effe9 commit af6adcd

File tree

2 files changed

+8
-49
lines changed

2 files changed

+8
-49
lines changed

activate.sh

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,5 @@
66
[[ "$(uname)" != "Linux" ]] && echo "unsupported operating system" >&2 && return 1
77
[[ ${BASH_VERSINFO[0]} -lt 4 || (${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 4) ]] && echo "requieres bash >= v4.4" >&2 && return 1
88

9-
insdir="$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")"
10-
toolsdir="$(dirname "$insdir")"
11-
unset OPTIND activate exitfun help
12-
while getopts ':i:c:x:a:h' arg; do
13-
case $arg in
14-
i) toolsdir="$OPTARG";;
15-
c) activate="$OPTARG";;
16-
x) exitfun="$OPTARG";;
17-
h) help=true;;
18-
a) shift $((OPTIND-2)); break;;
19-
:) if [[ "$OPTARG" == "a" ]]; then
20-
shift $((OPTIND-1))
21-
break
22-
else
23-
echo "argument missing" >&2
24-
fi
25-
return 1
26-
;;
27-
esac
28-
done
29-
30-
if [[ $BASHBONE_DIR ]]; then
31-
source "$BASHBONE_DIR/activate.sh" ${help:+-h} -i "${BASHBONE_TOOLSDIR:-$toolsdir}" -c ${activate:-false} -x "$exitfun" -a "$@" || return 1
32-
else
33-
source "$insdir/bashbone/activate.sh" ${help:+-h} -i "$toolsdir" -c ${activate:-false} -x "$exitfun" -a "$@" || return 1
34-
fi
35-
36-
[[ "$PATH" =~ ^$insdir: ]] || PATH="$insdir:$PATH"
37-
38-
_IFS=$IFS
39-
IFS=$'\n'
40-
for f in "$insdir/lib/"*.sh; do
41-
BASHBONE_ERROR="file not found $f"
42-
[[ -s "$f" ]]
43-
source "$f"
44-
done
45-
IFS=$_IFS
46-
47-
unset BASHBONE_ERROR
48-
return 0
9+
src="$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")"
10+
source "${BASHBONE_DIR:-$src/bashbone}/activate.sh" -s "$src" "$@" || return 1

lib/compile.sh

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,30 @@
11
#! /usr/bin/env bash
22
# (c) Konstantin Riege
33

4-
compile::bashbone() {
5-
local insdir threads version bashboneversion src="$(dirname "$(readlink -e "$0")")"
4+
function compile::bashbone(){
5+
local insdir threads cfg version bashboneversion src="$(dirname "$(dirname "$(readlink -e "$0")")")"
66
commander::printinfo "installing bashbone"
7-
compile::_parse -r insdir -s threads "$@"
7+
compile::_parse -r insdir -s threads -f cfg "$@"
88
source "$src/lib/version.sh"
99
rm -rf "$insdir/bashbone-$version"
1010
mkdir -p "$insdir/bashbone-$version"
1111
cp -r "$src"/* "$insdir/bashbone-$version"
12+
rm -f "$insdir/bashbone-$version/scripts/"+(setup|test).sh
1213
mkdir -p "$insdir/latest"
1314
ln -sfn "$insdir/bashbone-$version" "$insdir/latest/bashbone"
1415

1516
bashboneversion=$version
1617
src="$(dirname "$src")"
1718

1819
commander::printinfo "installing rippchen"
19-
compile::_parse -r insdir -s threads "$@"
2020
source "$src/lib/version.sh"
2121
rm -rf "$insdir/rippchen-$version"
2222
mkdir -p "$insdir/rippchen-$version"
23-
cp -r "$src"/!(bashbone|setup*) "$insdir/rippchen-$version"
23+
cp -r "$src"/!(bashbone) "$insdir/rippchen-$version"
24+
rm -f "$insdir/rippchen-$version/scripts/"+(setup|test).sh
2425
mkdir -p "$insdir/latest"
2526
ln -sfn "$insdir/rippchen-$version" "$insdir/latest/rippchen"
2627
ln -sfn "$insdir/bashbone-$bashboneversion" "$insdir/rippchen-$version/bashbone"
2728

2829
return 0
2930
}
30-
31-
compile::rippchen() {
32-
compile::bashbone
33-
}

0 commit comments

Comments
 (0)