Skip to content

Commit 522f934

Browse files
committed
bug fix for URL redirect dependencies
1 parent ecb021a commit 522f934

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,11 @@ url:commons-compiler:https://repo1.maven.org/maven2/org/codehaus/janino/commons-
151151
file:spring-context:bin\lib
152152
file:javax.activation:bin\lib
153153
file:core-api:modules\core
154+
url:CommissioningScripts-0.1.1.jar:https://github.com/automatic-controls/commissioning-scripts/releases/download/v0.1.1-beta/CommissioningScripts-0.1.1.jar
155+
url:CommissioningScripts-0.1.1-sources.jar:https://github.com/automatic-controls/commissioning-scripts/releases/download/v0.1.1-beta/CommissioningScripts-0.1.1-sources.jar
154156
```
155157

156-
The general format is `scheme:identifier:location`. For files, the location is a relative path to the folder in your *WebCTRL* installation which contains the dependency. For urls, the location is a direct download link. The identifier should be the first part of the dependency's filename (excluding the version). Dependency filenames are generally expected to match the regular expression `^identifier-\d.*\.jar$`.
158+
The general format is `scheme:identifier:location`. For files, the location is a relative path to the folder in your *WebCTRL* installation which contains the dependency. For urls, the location is a direct download link. The identifier should be the first part of the dependency's filename (excluding the version). Dependency filenames are generally expected to match the regular expression `^identifier-\d.*\.jar$`. Alternatively, the identifier may be an exact match to the filename (including the *.jar* extension).
157159

158160
## Keystore Management
159161

Utility.bat

+8-6
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ if "%1" EQU "--goto" (
4646
setlocal EnableDelayedExpansion
4747

4848
:: Version control
49-
set "version=1.1.0"
49+
set "version=1.1.1"
5050
if "%1" EQU "--version" (
5151
echo %version%
5252
exit /b
@@ -599,20 +599,22 @@ exit /b
599599
:: Parameters: <dependency-file> <output-folder>
600600
:collect
601601
setlocal
602-
set "tmp1=%settings%\tmp1"
603-
set "tmp2=%settings%\tmp2"
602+
set "tmp1=%~dp0tmp1"
603+
set "tmp2=%~dp0tmp2"
604604
set "err=0"
605605
set "msg=0"
606606
dir "%~f2\*.jar" /B /A-D 2>nul >"%tmp1%"
607607
for /F "usebackq tokens=1,2,* delims=:" %%i in ("%~f1") do (
608+
set "findString=%%j"
609+
if "!findString:~-4!" NEQ ".jar" set "findString=%%j-[0-9].*"
608610
set "exists=0"
609-
for /F %%a in ('findstr /R /X "%%j-[0-9].*" "%tmp1%"') do (
611+
for /F %%a in ('findstr /R /X "!findString!" "%tmp1%"') do (
610612
set "exists=1"
611613
)
612614
if "!exists!" EQU "0" (
613615
set "msg=1"
614616
if /I "%%i" EQU "url" (
615-
curl --fail --silent --output-dir "%~f2" --remote-name %%k
617+
curl --location --fail --silent --output-dir "%~f2" --remote-name %%k
616618
if !ErrorLevel! EQU 0 (
617619
echo Collected: %%j
618620
) else (
@@ -622,7 +624,7 @@ exit /b
622624
) else if /I "%%i" EQU "file" (
623625
set "file="
624626
dir "%WebCTRL%\%%k\*.jar" /B /A-D 2>nul >"%tmp2%"
625-
for /F %%a in ('findstr /R /X "%%j-[0-9].*" "%tmp2%"') do (
627+
for /F %%a in ('findstr /R /X "!findString!" "%tmp2%"') do (
626628
set "file=%%a"
627629
)
628630
if "!file!" EQU "" (

0 commit comments

Comments
 (0)