You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: install.sh
+18-7Lines changed: 18 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ if [ "$tag" ]; then
16
16
fi
17
17
18
18
ifcommand -v curl >/dev/null 2>&1;then
19
-
downloader="curl -sLO"
19
+
downloader="curl -sLO --fail"
20
20
elifcommand -v wget >/dev/null 2>&1;then
21
21
downloader="wget -q"
22
22
else
@@ -33,6 +33,10 @@ if [ -z "$PACT_CLI_VERSION" ]; then
33
33
echo"Sorry, you need set a version number PACT_CLI_VERSION as we can't determine the latest at this time. See https://github.com/you54f/pact-cli/releases/latest."
34
34
exit 1
35
35
fi
36
+
if [ -z"$PACT_CLI_VERSION" ];then
37
+
PACT_CLI_VERSION=vlatest
38
+
echo"No version specified, defaulting to $PACT_CLI_VERSION"
39
+
fi
36
40
37
41
echo"Thanks for downloading the latest release of pact-cli $PACT_CLI_VERSION."
38
42
echo"-----"
@@ -107,20 +111,27 @@ case $os in
107
111
;;
108
112
esac
109
113
114
+
PROJECT_NAME=pact-cli
110
115
echo
111
116
echo"-------------"
112
117
echo"Downloading ${filename} - version ${PACT_CLI_VERSION}"
113
118
echo"-------------"
114
-
($downloaderhttps://github.com/you54f/pact-cli/releases/download/"${PACT_CLI_VERSION}"/"${filename}"&&echo downloaded "${filename}") || (echo "Sorry, you'll need to install the pact-cli manually."&&exit 1)
115
-
(chmod +x "${filename}"&&echounarchived"${filename}") || (echo "Sorry, you'll need to unarchived the pact-cli manually."&&exit 1)
116
-
echo"pact-cli${PACT_CLI_VERSION} installed to $(pwd)"
($downloader https://github.com/you54f/pact-cli/releases/download/"${PACT_CLI_VERSION}"/"${filename}"&&echodownloaded"${filename}") || (echo "Failed to download pact-cli, check the version and url."&&exit 1)
121
+
echo"$PROJECT_NAME${PACT_CLI_VERSION} installed to $(pwd)"
117
122
echo"-------------------"
118
123
echo"available commands:"
119
124
echo"-------------------"
120
-
PROJECT_NAME=pact-cli
121
125
PACT_BROKER_CLI_BIN_PATH=${PWD}
122
-
mv $filename$PROJECT_NAME
123
-
chmod +x $PROJECT_NAME
126
+
if [[ "$filename"==*.exe ]];then
127
+
mv "$filename""$PROJECT_NAME.exe"
128
+
chmod +x "$PROJECT_NAME.exe"
129
+
else
130
+
mv "$filename""$PROJECT_NAME"
131
+
chmod +x "$PROJECT_NAME"
132
+
fi
133
+
./pact-cli --help
134
+
echo"-------------------"
124
135
if [ "$GITHUB_ENV" ];then
125
136
echo"Added the following to your path to make ${PROJECT_NAME} available:"
0 commit comments