mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2025-01-31 12:27:22 +02:00
fetch-archives: Allow to specify a regex
[why] Now where we have zip and tar.xz archives one might want to just fetch one specific one. So we need to have a pattern not only for the beginning of the file name. [how] Enable full regexes for the filtering. For this we need to escape blanks in the pattern/regex, that a user might specify (./fetch-archive.sh v2.2.2 'Some Font'). [note] This is already then used for the casks workflow, as that only needs the zips. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
parent
29c0d3f4e5
commit
5eebd95456
2
.github/workflows/casks.yml
vendored
2
.github/workflows/casks.yml
vendored
@ -23,7 +23,7 @@ jobs:
|
||||
run: |
|
||||
cd bin/scripts
|
||||
chmod u+x *
|
||||
./fetch-archives.sh latest
|
||||
./fetch-archives.sh latest '*zip'
|
||||
- name: Determine release tag
|
||||
id: releasetag
|
||||
run: |
|
||||
|
@ -15,6 +15,7 @@
|
||||
# fetch-archives v2.2.2
|
||||
# fetch-archives v2.2.2 Heavy
|
||||
# fetch-archives latest HeavyDat
|
||||
# fetch-archives v3.1.0 'Ara.*zip' (just fetch the zip archive)
|
||||
|
||||
set -e
|
||||
|
||||
@ -54,8 +55,8 @@ fi
|
||||
echo "${LINE_PREFIX} Found ${num} artifacts"
|
||||
|
||||
if [ $# -ge 2 ]; then
|
||||
pattern=$2
|
||||
echo "${LINE_PREFIX} Limiting archive to pattern '${pattern}'"
|
||||
pattern=${2// /\\ }
|
||||
echo "${LINE_PREFIX} Limiting archive to regex '${pattern}'"
|
||||
else
|
||||
pattern=""
|
||||
echo "${LINE_PREFIX} No limiting pattern given"
|
||||
@ -67,7 +68,7 @@ fi
|
||||
|
||||
for assetname in "${files[@]}"; do
|
||||
assetname=${assetname:1:-1}
|
||||
if [[ ! "${assetname}" =~ ^"${pattern}" ]]; then
|
||||
if [[ ! "${assetname}" =~ ${pattern} ]]; then
|
||||
continue
|
||||
fi
|
||||
echo >&2 "${LINE_PREFIX} Fetching ${versiontag}/${assetname}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user