forked from jpolo/laptop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·46 lines (38 loc) · 1.5 KB
/
install.sh
File metadata and controls
executable file
·46 lines (38 loc) · 1.5 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
#!/usr/bin/env bash
#==============================================================================
# 🔧 These variable can be changed to customize a forked laptop repository
#
RELEASE="main"
REPOSITORY_NAME=${REPOSITORY_NAME:-"Captive-Studio/laptop"}
export LAYOUT_PROFILE=captive
export LAPTOP_GIT_REMOTE="https://github.com/$REPOSITORY_NAME.git"
#==============================================================================
# 🔶 Do not change the content below
#
DOWNLOAD="https://github.com/$REPOSITORY_NAME/archive/$RELEASE.tar.gz"
PACKAGE_NAME=laptop-installer
PACKAGE_ARCHIVE="$PACKAGE_NAME.tar.gz"
DOWNLOAD_DIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'laptop-installer')
set -euo pipefail
echo '==================================='
echo 'Laptop installer'
echo '==================================='
echo
# Remove old laptop playbook
if [[ ! -x "$DOWNLOAD_DIR/$PACKAGE_ARCHIVE" ]]; then
echo "[Info] Clean previous $PACKAGE_NAME"
rm -rf "$DOWNLOAD_DIR$PACKAGE_NAME"*
fi
# Download and run laptop playbook
echo "[Info] Download $PACKAGE_NAME"
cd "$DOWNLOAD_DIR"
curl -fsSL -o "$PACKAGE_ARCHIVE" "$DOWNLOAD"
mkdir "$DOWNLOAD_DIR$PACKAGE_NAME"
tar -zxf "$PACKAGE_ARCHIVE" --directory "$DOWNLOAD_DIR$PACKAGE_NAME" --strip-components=1
# Modify the PATH
# This should be subsequently updated in shell settings
# export PATH=/usr/local/bin:$PATH
echo "[Info] Run $PACKAGE_NAME"
cd "$DOWNLOAD_DIR$PACKAGE_NAME"
# LAYOUT_PROFILE= will be asked during installation
"$DOWNLOAD_DIR$PACKAGE_NAME/bin/laptop" configure