Skip to content

Commit

Permalink
feat: add install.sh, uninstall.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
QiuZhiFei committed Jul 1, 2021
1 parent 8e42e4b commit 1da14e4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ __xchelper__ is a tool for iOS developers to automate tedious tasks like run, te

## Installation

xchelper can be installed from homebrew via
```bash
brew install xchelper
| Method | Command |
|:----------|:--------------------------------------------------------------------------------------------------|
| **curl** | `sh -c "$(curl -fsSL https://raw.githubusercontent.com/BlueIntent/xchelper/main/scripts/install.sh)"` |
| **wget** | `sh -c "$(wget -O- https://raw.githubusercontent.com/BlueIntent/xchelper/main/scripts/install.sh)"` |
``` diff
- brew install xchelper
+ GitHub repository not notable enough (<30 forks, <30 watchers and <75 stars)
```

## Usage
Expand Down
13 changes: 13 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

upstream_github_url="https://github.com/BlueIntent/xchelper"

PWD_DIR=$PWD
OUTPUT_DIR=$(mktemp -d -t xchelper-release)
echo $OUTPUT_DIR
git clone $upstream_github_url $OUTPUT_DIR
cd $OUTPUT_DIR && make install && cd $PWD_DIR
rsync -r $OUTPUT_DIR/build/package/* /usr/local/bin
rm -rf $OUTPUT_DIR
echo "Successfully installed"
xchelper --version
2 changes: 0 additions & 2 deletions scripts/make_release.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

# OUTPUT_DIR=$(mktemp -d -t xchelper-release)

ROOT_PATH=$(pwd)
BUILD_PATH=$ROOT_PATH/build
PACKAGE_PATH=$BUILD_PATH/package
Expand Down
9 changes: 9 additions & 0 deletions scripts/uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

BIN_PATH=/usr/local/bin

if [ $(ls $BIN_PATH | grep -c xchelper) -gt 0 ]; then
rm $BIN_PATH/xchelper
fi

echo "Thanks for trying out xchelper. It's been uninstalled."

0 comments on commit 1da14e4

Please sign in to comment.