Skip to content

Commit ee5c712

Browse files
quantenzitronexsuchy
authored andcommitted
test-one-license: modernize bash script
this makes the script runnable on nixos and other distros that don't install bash in /bin
1 parent 4765bf7 commit ee5c712

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

test-one-license

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
2+
#
3+
# Usage:
4+
# ./test-one-license <Short ID>
5+
#
6+
# any other command line arguments are ignored
27

3-
TOOL_VERSION=`awk '/^TOOL_VERSION/{print $NF}' Makefile`
8+
TOOL_VERSION="$(awk '/^TOOL_VERSION/{print $NF}' Makefile)"
49
PUBLISHER=licenseListPublisher-${TOOL_VERSION}.jar
510

611
# if license list publisher is not present, download it
7-
test ! -f ${PUBLISHER} && make ${PUBLISHER}-valid
12+
test ! -f "${PUBLISHER}" && make "${PUBLISHER}-valid"
813

9-
java -jar ${PUBLISHER} TestLicenseXML "src/${@}.xml" "test/simpleTestForGenerator/${@}.txt" "test/fullTestForGenerator"
14+
java -jar "${PUBLISHER}" TestLicenseXML "src/${1}.xml" "test/simpleTestForGenerator/${1}.txt" "test/fullTestForGenerator"

0 commit comments

Comments
 (0)