Skip to content

Commit

Permalink
modify name to install.sh && install colink-playbook to $COLINK_HOME
Browse files Browse the repository at this point in the history
  • Loading branch information
walotta committed Jun 3, 2023
1 parent f128cc4 commit ed23caa
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ This module can be used to quickly set up a CoLink protocol with just a few line

## Running a Protocol by Playbook

1. Download the release binary of your system from GitHub.
1. install the playbook from GitHub.

```bash
bash -c "$(curl -fsSL https://raw.githubusercontent.com/CoLearn-Dev/colink-playbook-dev/main/download.sh)"
bash -c "$(curl -fsSL https://raw.githubusercontent.com/CoLearn-Dev/colink-playbook-dev/main/install.sh)"
```

You can also build from source
Expand Down
11 changes: 0 additions & 11 deletions download.sh

This file was deleted.

26 changes: 26 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
tag=$(wget -qO- -t1 -T2 "https://api.github.com/repos/CoLearn-Dev/colink-playbook-dev/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')
download_url=https://github.com/CoLearn-Dev/colink-playbook-dev/releases/download/${tag}

if [ -z $COLINK_HOME ]; then
COLINK_HOME="$HOME/.colink"
fi
mkdir -p $COLINK_HOME
echo "Install colink-playbook to $COLINK_HOME"

PACKAGE_NAME="colink-playbook-linux-x86_64"
if [ "$(uname)" == "Darwin" ]; then
PACKAGE_NAME="colink-playbook-macos-x86_64"
fi

URL="${download_url}/${PACKAGE_NAME}"
if command -v curl > /dev/null ; then
curl -fsSL $URL -o $COLINK_HOME/colink-playbook
elif command -v wget > /dev/null ; then
wget $URL -O $COLINK_HOME/colink-playbook
else
print_str "command not found: wget or curl"
exit 1
fi

chmod +x $COLINK_HOME/colink-playbook
echo "Install colink-playbook: done"

0 comments on commit ed23caa

Please sign in to comment.