Skip to content

Commit

Permalink
merge extension and cli app repos.
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkWeird committed Nov 9, 2021
1 parent 98eee4f commit 738acc5
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 7 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,3 @@ jobs:
- name: set release version
run: |
echo '${{ github.ref_name }}' > tag
- name: Push files
run: |
git config user.name github-actions
git config user.email [email protected]
git add tag
git commit -m "[Automatic] bumpup version to ${{ github.ref_name }}"
git push
66 changes: 66 additions & 0 deletions gh-echojava
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/bash
set -e

extensionPath="$(dirname "$0")"

tag=v0.1.7
imagename="gh-echo"
repo="DarkWeird/gh-echojava"
arch="$(uname -m)"

exe=""

# resolve exe name for fetch release from GitHub releases.
if uname -a | grep Msys > /dev/null; then
if [ $arch = "x86_64" ]; then
exe="${imagename}-Windows.exe"
fi
elif uname -a | grep Darwin > /dev/null; then
if [ $arch = "x86_64" ]; then
exe="${imagename}-macOS"
fi
elif uname -a | grep Linux > /dev/null; then
if [ $arch = "x86_64" ]; then
exe="${imagename}-Linux"
fi
fi

executablePath = "";

if [ "${exe}" == "" ]; then
if uname -a | grep Msys >/dev/null; then
imagename = "${imagename}.exe"
fi
if [[ -x "${extensionPath}/build/libs/gh-echo-0.1-all.jar"]]; then
# JVM variant
executablePath = "${extensionPath}/build/libs/gh-echo-0.1-all.jar"
elif [[ -x "${extensionPath}/build/native/nativeCompile/${imagename}"]]; then
# Native Image variant
executablePath = "${extensionPath}/build/native/nativeCompile/${imagename}"
else
if [ ! "$(which javac)" = "" ]; then
if [ ! "$(which native-image)" = ""]; then
./gradlew nativeCompile
executablePath = "${extensionPath}/build/native/nativeCompile/${imagename}"
else
./gradlew shadowJar
executablePath = "${extensionPath}/build/libs/gh-echo-0.1-all.jar"
fi
else
echo "You haven't java for building this project"
exit 1;
fi
fi

else
executablePath = "${extensionPath}/${exe}"
# Check release executable
if [[ ! -x "${executablePath}" ]]; then
#Fetch release
gh release -R"${repo}" download "${tag}" -p "${exe}" --dir "${extensionPath}"
e
chmod +x "${executablePath}"
fi
fi

exec "${extensionPath}/${exe}" "$@"

0 comments on commit 738acc5

Please sign in to comment.