Skip to content

Commit 4301437

Browse files
committed
add install script
1 parent 6a54113 commit 4301437

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
# CPTOOL
22

33
Simple bash script to compile and run your solution when solving competitive programming problems.
4+
5+
## How To Install
6+
7+
Run this command in your bash shell
8+
9+
```
10+
curl -L -s https://raw.githubusercontent.com/jauhararifin/cptool/master/install.sh | bash
11+
```

install.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
INSTALL_DIR=$HOME/.cptool
4+
5+
curl -Lo /tmp/cptool.tar.gz https://github.com/jauhararifin/cptool/archive/v0.0.0.tar.gz > /dev/null 2> /dev/null
6+
mkdir -p $INSTALL_DIR
7+
tar -xf /tmp/cptool.tar.gz -C $INSTALL_DIR --strip 1
8+
9+
if [ -z $CPTOOL_DIR ]; then
10+
export CPTOOL_DIR="$INSTALL_DIR"
11+
export PATH=$PATH:$CPTOOL_DIR
12+
echo "" >> $HOME/.bashrc
13+
echo "export CPTOOL_DIR=\"$INSTALL_DIR\"" >> $HOME/.bashrc
14+
echo "export PATH=\"\$PATH:\$CPTOOL_DIR\"" >> $HOME/.bashrc
15+
fi
16+
17+
echo "Installed"

0 commit comments

Comments
 (0)