Skip to content

Commit c12abb6

Browse files
committed
travisify.sh: use xmllint to extract repoSlug
We already require xmllint for the other POM extractions. It is more robust in that it will always find the correct child element, whereas grep alone might conceivably pick up anything such as an XML comment.
1 parent 1664dd9 commit c12abb6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

travisify.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ process() {
6666
cd "$1"
6767

6868
# -- Git sanity checks --
69-
repoSlug=$(grep '<connection>' pom.xml 2>/dev/null | sed 's/[^>]*>//' | sed 's/<.*//' | cut -d'/' -f4,5)
69+
repoSlug=$(xmllint --xpath "//*[local-name()='project']/*[local-name()='scm']/*[local-name()='connection']" pom.xml|sed 's_.*github.com[:/]\(.*\)<.*_\1_')
7070
test "$repoSlug" && info "Repository = $repoSlug" || die 'Could not determine GitHub repository slug'
7171
git fetch >/dev/null
7272
git diff-index --quiet HEAD -- || die "Dirty working copy"

0 commit comments

Comments
 (0)