-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrelease_files.sh
executable file
·41 lines (37 loc) · 1.21 KB
/
release_files.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
gh auth login --with-token <<<"$GITHUB_TOKEN"
ICS_CALENDARS=""
for year in $(find ICSs/* -type d | cut -d '/' -f 2);
do
for file in $(find ICSs/${year}/*.ics -type f);
do
ZONA=$(echo $file | sed 's/\..*//g' | cut -d "/" -f 3 | cut -d "_" -f 1)
FORMATO=$(echo $file | cut -d "." -f 2)
ICS_CALENDARS+="'./${file}#$ZONA' "
done
if [ -z "$(gh release view $year-ICS 2> /dev/null | cat)" ]
then
eval "gh release create \"$year-ICS\" -t \"$year-ICS\" -n \"Calendari $year in formato ICS\" $ICS_CALENDARS"
else
echo "Release $year-ICS already present, skipping..."
fi
export ICS_CALENDARS=""
done
sleep 20
CSV_CALENDARS=""
for year in $(find CSVs/* -type d | cut -d '/' -f 2);
do
for file in $(find CSVs/${year}/*.csv -type f);
do
ZONA=$(echo $file | sed 's/\..*//g' | cut -d "/" -f 3 | cut -d "_" -f 1)
FORMATO=$(echo $file | cut -d "." -f 2)
CSV_CALENDARS+="'./${file}#$ZONA' "
done
if [ -z "$(gh release view $year-CSV 2> /dev/null | cat)" ]
then
eval "gh release create \"$year-CSV\" -t \"$year-CSV\" -n \"Calendari $year in formato CSV\" $CSV_CALENDARS"
else
echo "Release $year-CSV already present, skipping..."
fi
export CSV_CALENDARS=""
done