diff --git a/README.md b/README.md index 5fd21a1..1368db0 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ This action provides the following functionality for GitHub Actions users: - Installing a version of Jython and adding it to `PATH` +- Customizing the installation path ## Basic usage @@ -16,6 +17,7 @@ steps: uses: LukeSavefrogs/setup-jython@v1 with: jython-version: '2.5.2' + installation-path: '~/jython/' # Default - run: jython -c 'import sys, os; print(os.name, sys.version)'; ``` diff --git a/action.yml b/action.yml index 45d4813..524ba01 100644 --- a/action.yml +++ b/action.yml @@ -5,7 +5,12 @@ inputs: jython-version: description: 'The version of Jython to use' required: true - default: '2.7.2' + default: "2.7.2" + + installation-path: + description: 'The path where Jython will be installed' + required: false + default: "~/jython/" outputs: jython-download-url: @@ -76,18 +81,20 @@ runs: # This is why I use the standard installation # java -jar /tmp/jython_installer.jar \ # --silent \ - # --directory ~/jython/ \ + # --directory ${{ inputs.installation-path }} \ # --type standalone; java -jar /tmp/jython_installer.jar \ --silent \ - --directory ~/jython/ \ + --directory ${{ inputs.installation-path }} \ --type standard; - name: Setup Jython alias shell: bash run: | + installation_path="$(sed -r 's/^\s+//; s/\s+$//; ' <<< "${{ inputs.installation-path }}")" + mkdir -p ~/.local/bin; - echo 'java -jar ~/jython/jython.jar "$@"' >> ~/.local/bin/jython; + echo 'java -jar ${installation_path}/jython.jar "$@"' >> ~/.local/bin/jython; chmod +x ~/.local/bin/jython; echo ~/.local/bin >> $GITHUB_PATH