diff options
author | Kali Kaneko <kali@leap.se> | 2017-07-24 18:00:19 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2017-07-25 12:26:47 -0400 |
commit | 1b1c10379da1f298fb08de4a7ca01c66175d4858 (patch) | |
tree | 18678e0afb5c5a9c7d81030a5f2b72bff0794719 | |
parent | c56cdc970110ab8a4f6394fb213cdeee483c3e0f (diff) |
[dev] add bootstrap script
-rwxr-xr-x | pkg/tools/bitmask-bootstrap.sh | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/pkg/tools/bitmask-bootstrap.sh b/pkg/tools/bitmask-bootstrap.sh new file mode 100755 index 00000000..513b649a --- /dev/null +++ b/pkg/tools/bitmask-bootstrap.sh @@ -0,0 +1,51 @@ +#!/bin/bash +####################################### +# Bootstrap a bitmask-dev environment # +####################################### + +set -e + +APT_DEPS="build-essential python-dev python-virtualenv libsqlcipher-dev libssl1.0-dev libffi-dev python-pyqt5 python-pyqt5.qtwebkit" + +function add_pew_to_environment() +{ + while true; do + read -p "Do you want to add pew executable to your .zshrc?> " yn + case $yn in + [Yy]* ) echo "PATH=~/.local/bin:\$PATH" >> ~/.zshrc; echo "source \$(pew shell_config)" >> ~/.zshrc; break;; + [Nn]* ) exit;; + * ) echo "Please answer yes or no.";; + esac + done +} + +function init_pew() +{ + which pew || pip install pew + which pew || add_pew_to_environment + PATH=~/.local/bin:$PATH + pew ls | grep bitmask || pew new bitmask +} + +function apt_install() +{ + sudo apt install $APT_DEPS +} + +function clone_repo() +{ + mkdir -p ~/leap/ && cd ~/leap + git clone https://0xacab.org/leap/bitmask-dev || echo 'not cloning: bitmask-dev already exists...' +} + +function install_deps() +{ + cd ~/leap/bitmask-dev && pew in bitmask pip install -r pkg/requirements-dev.pip + cd ~/leap/bitmask-dev && pew in bitmask pip install -r pkg/requirements-testing.pip + cd ~/leap/bitmask-dev && pew in bitmask make dev-all +} + +init_pew +apt_install +clone_repo +install_deps |