File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,18 @@ if [ "$#" -ne "4" ]; then
1414 exit
1515fi
1616
17- REPO=" https://cloudsmith.io/~$3 /repos/"
18- echo " Issuing command: wget -q -O - $REPO $1 -$4 /packages/?q=*$2 *.xml"
17+ NAME=" $1 "
18+ VERSION=" $2 "
19+ USER=" $3 "
20+ LEVEL=" $4 "
21+
22+ REPO=" https://cloudsmith.io/~${USER} /repos/"
23+ echo " Issuing command: wget -q -O - $REPO ${NAME} -${LEVEL} /packages/?q=*${VERSION} *.xml"
1924my_array=()
2025echo " Show current files that match criteria"
21- ls metadata/$1 * - $2 * xml -la
26+ ls metadata/${NAME} * - * ${VERSION} * xml -la
2227echo " Deleting current files that match criteria"
23- rm metadata/$1 * - $2 * xml
28+ rm metadata/${NAME} * - * ${VERSION} * xml
2429echo " Finding files on remote cloudsmith repository"
2530delimiter=" href=\" "
2631delimiter1=" .xml\" title"
@@ -35,7 +40,7 @@ while read -r line; do
3540 my_array+=( $line );
3641 echo " found: $line "
3742 fi
38- done < <( wget -q -O - " $REPO $1 - $4 /packages/?q=*$2 *xml" )
43+ done < <( wget -q -O - " $REPO ${NAME} - ${LEVEL} /packages/?q=*${VERSION} *xml+tag:latest&page_size=50 " )
3944
4045echo " Downloading files found that match criteria"
4146for URL in " ${my_array[@]} "
4449 wget --progress=bar:force:noscroll -c $URL -P metadata
4550done
4651echo " Files downloaded"
47- ls -l metadata/$1 * - $2 * xml
52+ ls -la metadata/${NAME} * - * ${VERSION} * xml
4853
You can’t perform that action at this time.
0 commit comments