Skip to content

Commit c8b7c9f

Browse files
authored
Merge pull request #23 from amr-labib/master
feat: make shell scripts POSIX compliant
2 parents 8bc8110 + 08a23f9 commit c8b7c9f

7 files changed

+14
-7
lines changed

packaging/pact-broker.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ set -e
44
SOURCE="$0"
55
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
66
TARGET="$(readlink "$SOURCE")"
7-
if [[ $TARGET == /* ]]; then
7+
START="$( echo "$TARGET" | cut -c 1 )"
8+
if [ "$START" = "/" ]; then
89
SOURCE="$TARGET"
910
else
1011
DIR="$( dirname "$SOURCE" )"

packaging/pact-message.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ set -e
44
SOURCE="$0"
55
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
66
TARGET="$(readlink "$SOURCE")"
7-
if [[ $TARGET == /* ]]; then
7+
START="$( echo "$TARGET" | cut -c 1 )"
8+
if [ "$START" = "/" ]; then
89
SOURCE="$TARGET"
910
else
1011
DIR="$( dirname "$SOURCE" )"

packaging/pact-mock-service.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ set -e
44
SOURCE="$0"
55
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
66
TARGET="$(readlink "$SOURCE")"
7-
if [[ $TARGET == /* ]]; then
7+
START="$( echo "$TARGET" | cut -c 1 )"
8+
if [ "$START" = "/" ]; then
89
SOURCE="$TARGET"
910
else
1011
DIR="$( dirname "$SOURCE" )"

packaging/pact-provider-verifier.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ set -e
44
SOURCE="${BASH_SOURCE[0]}"
55
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
66
TARGET="$(readlink "$SOURCE")"
7-
if [[ $TARGET == /* ]]; then
7+
START="$( echo "$TARGET" | cut -c 1 )"
8+
if [ "$START" = "/" ]; then
89
SOURCE="$TARGET"
910
else
1011
DIR="$( dirname "$SOURCE" )"

packaging/pact-publish.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ set -e
44
SOURCE="${BASH_SOURCE[0]}"
55
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
66
TARGET="$(readlink "$SOURCE")"
7-
if [[ $TARGET == /* ]]; then
7+
START="$( echo "$TARGET" | cut -c 1 )"
8+
if [ "$START" = "/" ]; then
89
SOURCE="$TARGET"
910
else
1011
DIR="$( dirname "$SOURCE" )"

packaging/pact-stub-service.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ set -e
44
SOURCE="$0"
55
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
66
TARGET="$(readlink "$SOURCE")"
7-
if [[ $TARGET == /* ]]; then
7+
START="$( echo "$TARGET" | cut -c 1 )"
8+
if [ "$START" = "/" ]; then
89
SOURCE="$TARGET"
910
else
1011
DIR="$( dirname "$SOURCE" )"

packaging/pact.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ set -e
44
SOURCE="$0"
55
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
66
TARGET="$(readlink "$SOURCE")"
7-
if [[ $TARGET == /* ]]; then
7+
START="$( echo "$TARGET" | cut -c 1 )"
8+
if [ "$START" = "/" ]; then
89
SOURCE="$TARGET"
910
else
1011
DIR="$( dirname "$SOURCE" )"

0 commit comments

Comments
 (0)