Repository navigation
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·79 lines (68 loc) · 3.98 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·79 lines (68 loc) · 3.98 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
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
76
77
78
79
#!/usr/bin/env bash
# install.sh — Install xcind to a PREFIX directory
set -euo pipefail
XCIND_ROOT="${0%/*}"
PREFIX="${1:-/usr/local}"
echo "Installing xcind to $PREFIX ..."
install -d "$PREFIX/bin"
install -d "$PREFIX/lib/xcind"
install -m 755 "$XCIND_ROOT/bin/xcind" "$PREFIX/bin/xcind"
install -m 755 "$XCIND_ROOT/bin/xcind-application" "$PREFIX/bin/xcind-application"
install -m 755 "$XCIND_ROOT/bin/xcind-compose" "$PREFIX/bin/xcind-compose"
install -m 755 "$XCIND_ROOT/bin/xcind-config" "$PREFIX/bin/xcind-config"
install -m 755 "$XCIND_ROOT/bin/xcind-prompt" "$PREFIX/bin/xcind-prompt"
install -m 755 "$XCIND_ROOT/bin/xcind-proxy" "$PREFIX/bin/xcind-proxy"
install -m 755 "$XCIND_ROOT/bin/xcind-run" "$PREFIX/bin/xcind-run"
install -m 755 "$XCIND_ROOT/bin/xcind-workspace" "$PREFIX/bin/xcind-workspace"
# xcind-app alias — short form mirroring Scind's `scind app …`. Recreate on
# every install so the link always points at the current xcind-application.
ln -sf "xcind-application" "$PREFIX/bin/xcind-app"
install -m 644 "$XCIND_ROOT/lib/xcind/xcind-bootstrap.bash" "$PREFIX/lib/xcind/xcind-bootstrap.bash"
install -m 644 "$XCIND_ROOT/lib/xcind/xcind-lib.bash" "$PREFIX/lib/xcind/xcind-lib.bash"
install -m 644 "$XCIND_ROOT/lib/xcind/xcind-naming-lib.bash" "$PREFIX/lib/xcind/xcind-naming-lib.bash"
install -m 644 "$XCIND_ROOT/lib/xcind/xcind-app-lib.bash" "$PREFIX/lib/xcind/xcind-app-lib.bash"
install -m 644 "$XCIND_ROOT/lib/xcind/xcind-assigned-lib.bash" "$PREFIX/lib/xcind/xcind-assigned-lib.bash"
install -m 644 "$XCIND_ROOT/lib/xcind/xcind-proxy-lib.bash" "$PREFIX/lib/xcind/xcind-proxy-lib.bash"
install -m 644 "$XCIND_ROOT/lib/xcind/xcind-registry-lib.bash" "$PREFIX/lib/xcind/xcind-registry-lib.bash"
install -m 644 "$XCIND_ROOT/lib/xcind/xcind-run-lib.bash" "$PREFIX/lib/xcind/xcind-run-lib.bash"
install -m 644 "$XCIND_ROOT/lib/xcind/xcind-workspace-lib.bash" "$PREFIX/lib/xcind/xcind-workspace-lib.bash"
install -m 644 "$XCIND_ROOT/lib/xcind/xcind-app-env-lib.bash" "$PREFIX/lib/xcind/xcind-app-env-lib.bash"
install -m 644 "$XCIND_ROOT/lib/xcind/xcind-host-gateway-lib.bash" "$PREFIX/lib/xcind/xcind-host-gateway-lib.bash"
install -m 644 "$XCIND_ROOT/lib/xcind/xcind-completion-bash.bash" "$PREFIX/lib/xcind/xcind-completion-bash.bash"
install -m 644 "$XCIND_ROOT/lib/xcind/xcind-completion-zsh.bash" "$PREFIX/lib/xcind/xcind-completion-zsh.bash"
install -m 644 "$XCIND_ROOT/lib/xcind/xcind-discovery-lib.bash" "$PREFIX/lib/xcind/xcind-discovery-lib.bash"
install -m 644 "$XCIND_ROOT/lib/xcind/xcind-hostenv-lib.bash" "$PREFIX/lib/xcind/xcind-hostenv-lib.bash"
# Build provenance: emit xcind-build-info.bash when installing from a git
# checkout. Tarballs without a .git directory get a plain XCIND_VERSION.
_xcind_write_build_info() {
command -v git >/dev/null 2>&1 || return 0
git -C "$XCIND_ROOT" rev-parse --git-dir >/dev/null 2>&1 || return 0
local short_rev long_rev ref date dirty
short_rev=$(git -C "$XCIND_ROOT" rev-parse --short=7 HEAD 2>/dev/null || echo "")
long_rev=$(git -C "$XCIND_ROOT" rev-parse HEAD 2>/dev/null || echo "")
ref=$(git -C "$XCIND_ROOT" rev-parse --abbrev-ref HEAD 2>/dev/null || echo "")
[ "$ref" = "HEAD" ] && ref=""
date=$(git -C "$XCIND_ROOT" log -1 --format=%cI HEAD 2>/dev/null || echo "")
if git -C "$XCIND_ROOT" diff --quiet HEAD -- 2>/dev/null &&
git -C "$XCIND_ROOT" diff --cached --quiet HEAD -- 2>/dev/null; then
dirty="0"
else
dirty="1"
fi
{
printf '%s\n' '#!/usr/bin/env bash'
printf '%s\n' '# xcind-build-info.bash — Generated by install.sh. Do not edit.'
printf '\n'
printf 'XCIND_BUILD_SOURCE=%q\n' "install"
printf 'XCIND_BUILD_SHORT_REV=%q\n' "$short_rev"
printf 'XCIND_BUILD_LONG_REV=%q\n' "$long_rev"
printf 'XCIND_BUILD_REF=%q\n' "$ref"
printf 'XCIND_BUILD_DATE=%q\n' "$date"
printf 'XCIND_BUILD_DIRTY=%q\n' "$dirty"
} >"$PREFIX/lib/xcind/xcind-build-info.bash"
chmod 644 "$PREFIX/lib/xcind/xcind-build-info.bash"
}
_xcind_write_build_info
echo "Done."
echo ""
"$PREFIX/bin/xcind-config" --check || true