Skip to content

Commit

Permalink
feat(scripts): clean up scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
amazingandyyy committed Apr 17, 2022
1 parent 5729267 commit ce919e3
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 43 deletions.
1 change: 0 additions & 1 deletion NAME

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go fuzzy search repos in regex and clone
# Installation

```sh
bash <(curl -sL https://raw.githubusercontent.com/amazingandyyy/gofuzzyclone/main/install.sh)
bash <(curl -sL https://raw.githubusercontent.com/amazingandyyy/gofuzzyclone/main/scripts/install.sh)
```

## Preparation
Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

Binary file modified bin/gofuzzyclone
Binary file not shown.
26 changes: 0 additions & 26 deletions install.sh

This file was deleted.

11 changes: 0 additions & 11 deletions release.sh

This file was deleted.

23 changes: 23 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
export stable_version=0.0.6

export package_name=gofuzzyclone
export author=amazingandyyy
[[ -n "$1" ]] && stable_version=$1

echo "> installing $package_name@$stable_version"
curl -LsO https://github.com/$author/$package_name/archive/refs/tags/$stable_version.zip &&
unzip -o $stable_version.zip &&
rm -rf /opt/homebrew/bin/$package_name &&
sudo touch /opt/homebrew/bin/$package_name &&
chmod +x $package_name-$stable_version/bin/$package_name &&
mv -f $package_name-$stable_version/bin/$package_name /opt/homebrew/bin
rm -rf $package_name-$stable_version $stable_version.zip

if ! [[ -x $(command -v $package_name) ]]; then
echo "$package_name failed to install" >&2
exit 1
else
echo "Installed $package_name@$stable_version successfully!"
gofuzzyclone -help
fi
7 changes: 4 additions & 3 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

REPO_DIR="$(dirname "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )")"
package_name=`cat $REPO_DIR/NAME`
export REPO_DIR="$(dirname "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )")"
export package_name=$(basename $REPO_DIR)

(set -x; go build $package_name.go && mv $package_name $REPO_DIR/bin/$package_name)
(set -x; go build $REPO_DIR/src/main.go)
mv $REPO_DIR/main $REPO_DIR/bin/$package_name
File renamed without changes.

0 comments on commit ce919e3

Please sign in to comment.