Skip to content

Commit

Permalink
chore: add installation scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
sumanchapai committed Mar 22, 2024
1 parent 9f0af9b commit 307a35f
Show file tree
Hide file tree
Showing 2 changed files with 442 additions and 0 deletions.
23 changes: 23 additions & 0 deletions scripts/install.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh
set -e

add_usr_local_bin_to_path() {
TO_ADD=~/.local/bin
echo "\nAdding $TO_ADD to your path."
echo "Either provide password for superuser permission to append to /etc/paths."
echo "Or press <Control+c> at this point and add it to path yourself\n"
echo $TO_ADD | sudo tee -a /etc/paths
LINE_TO_ADD="PATH=\$PATH:$TO_ADD" >> ~/.zshrc
}

install_in_usr_local() {
mkdir -p ~/.local
cd ~/.local
curl -s https://github.com/opensource-nepal/ad2bs/blob/main/scripts/install_main.txt | sh
# If command ad2bs is not found add user .local/bin to path
command -v ad2bs || add_usr_local_bin_to_path
cd -
}

install_in_usr_local
(command -v ad2bs && echo "\nad2bs installed") || echo "\nRestart start your terminal and start using ad2bs"
Loading

0 comments on commit 307a35f

Please # to comment.