Merge pull request #2006 from gaelicWizard/plugin-java

Plugin/Java: quote path and provide useful error message
pull/2009/head
Noah Gorny 2022-01-01 22:56:21 +02:00 committed by GitHub
commit c5d3b258ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -97,6 +97,7 @@ plugins/available/history-search.plugin.bash
plugins/available/history-substring-search.plugin.bash plugins/available/history-substring-search.plugin.bash
plugins/available/history.plugin.bash plugins/available/history.plugin.bash
plugins/available/hub.plugin.bash plugins/available/hub.plugin.bash
plugins/available/java.plugin.bash
plugins/available/jekyll.plugin.bash plugins/available/jekyll.plugin.bash
plugins/available/jump.plugin.bash plugins/available/jump.plugin.bash
plugins/available/less-pretty-cat.plugin.bash plugins/available/less-pretty-cat.plugin.bash

View File

@ -1,11 +1,11 @@
cite about-plugin # shellcheck shell=bash
about-plugin 'Java and JAR helper functions' about-plugin 'Java and JAR helper functions'
function jar_manifest { function jar_manifest {
about "extracts the specified JAR file's MANIFEST file and prints it to stdout" about "extracts the specified JAR file's MANIFEST file and prints it to stdout"
group 'java' group 'java'
param '1: JAR file to extract the MANIFEST from' param '1: JAR file to extract the MANIFEST from'
example 'jar_manifest lib/foo.jar' example 'jar_manifest lib/foo.jar'
unzip -c $1 META-INF/MANIFEST.MF unzip -c "${1:?${FUNCNAME[0]}: JAR file must be specified}" META-INF/MANIFEST.MF
} }