-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall
More file actions
executable file
·27 lines (22 loc) · 745 Bytes
/
install
File metadata and controls
executable file
·27 lines (22 loc) · 745 Bytes
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
#!/usr/bin/env bash
#
# To install, run
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/sschmid/pw-terminal-password-manager/main/install)"
set -e
INST_DIR="/opt/pw"
BIN_PATH="/usr/local/bin/pw"
if [[ $1 == "--uninstall" ]]; then
rm -rf "${INST_DIR}" "${BIN_PATH}"
echo "pw has been uninstalled successfully"
exit
fi
if [[ -d "${INST_DIR}" ]]; then
echo "It seems like pw is already installed at ${INST_DIR}"
echo "Run 'pw update' to update pw to the latest version"
exit
fi
git clone https://github.com/sschmid/pw-terminal-password-manager "${INST_DIR}"
echo "Linking ${INST_DIR}/src/pw to ${BIN_PATH}"
mkdir -p "$(dirname "${BIN_PATH}")"
ln -sf "${INST_DIR}/src/pw" "${BIN_PATH}"
echo "pw has been installed successfully"