-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_app.sh
More file actions
39 lines (28 loc) · 1.08 KB
/
install_app.sh
File metadata and controls
39 lines (28 loc) · 1.08 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
#! /bin/bash
# Location of lockin settings file
SETTINGS_FILE="src/lockin/settings.py"
#User input
read -p "Please enter your name: " HOST_NAME
read -r -p "Please enter network shared folder location. Example: /Volumes/NAS/. Press enter to skip. " NETWORK_SHARE
# Target strings to up date in settings file
HOST_TARGET_KEY="HOST"
NET_SHARE_TARGET_KEY="NETWORK_SHARE_URI"
# Replace strings in settings file
sed -i -e "s|\($HOST_TARGET_KEY *= *\).*|\1'$HOST_NAME'|" $SETTINGS_FILE
sed -i -e "s|\($NET_SHARE_TARGET_KEY *= *\).*|\1'$NETWORK_SHARE'|" $SETTINGS_FILE
# If virtualenv not installed, download & install it for user
if ! python3 -c "import virtualenv" &> /dev/null; then
python3 -m pip install --user virtualenv
fi
# Create virtual env and install dependencies
python3 -m virtualenv lockin_env
source lockin_env/bin/activate
pip install -r requirements.txt
# Install briefcase
pip install briefcase
# Build app template
briefcase build
# Package app template to build disk image
briefcase package --no-sign
# Open disk image to promp user and install
open macOS/LockIn-0.0.1.dmg