Fix indentation & remove tabs
This commit is contained in:
parent
f8c31523c9
commit
4c8d0de5ba
@ -107,14 +107,14 @@ generateSpecificReport()
|
||||
#$(curl -s "https://forge.chapril.org/api/v1/admin/orgs?limit=100000&token=$GITEA_API_KEY" | jq '. | length' > t)
|
||||
local organizationCount=$(curl -s "https://forge.chapril.org/api/v1/admin/orgs?limit=100000&token=$GITEA_API_KEY" | jq '. | length')
|
||||
if [[ -z "$organizationCount" ]]; then
|
||||
organizationCount=0
|
||||
organizationCount=0
|
||||
fi
|
||||
echo "Nombre d'organisations = $organizationCount"
|
||||
|
||||
#$(curl -s "https://forge.chapril.org/api/v1/orgs?limit=100000" > t)
|
||||
local publicOrganizationCount=$(curl -s "https://forge.chapril.org/api/v1/orgs?limit=100000" | jq '. | length')
|
||||
if [[ -z "$publicOrganizationCount" ]]; then
|
||||
publicOrganizationCount=0
|
||||
publicOrganizationCount=0
|
||||
fi
|
||||
echo "Nombre d'organisations publiques = $publicOrganizationCount"
|
||||
|
||||
@ -157,45 +157,45 @@ if [ "$#" = 1 ] && [ "$1" = "-h" ]; then
|
||||
help
|
||||
elif [ "$#" = 1 ] && [ "$1" = "-p" ]; then
|
||||
if [ "$(date +%m)" -gt 1 ]; then
|
||||
precedingMonth="$((10#$(date +%m)-1))"
|
||||
year="$(date +%Y)"
|
||||
if [ $precedingMonth -lt 10 ]; then
|
||||
yearMonth="$year-0$precedingMonth"
|
||||
else
|
||||
yearMonth="$year-$precedingMonth"
|
||||
fi
|
||||
precedingMonth="$((10#$(date +%m)-1))"
|
||||
year="$(date +%Y)"
|
||||
if [ $precedingMonth -lt 10 ]; then
|
||||
yearMonth="$year-0$precedingMonth"
|
||||
else
|
||||
yearMonth="$year-$precedingMonth"
|
||||
fi
|
||||
else [ "$(date +%m)" -eq 1 ]
|
||||
precedingMonth=12
|
||||
year="$(($(date +%Y)-1))"
|
||||
yearMonth="$year-$precedingMonth"
|
||||
precedingMonth=12
|
||||
year="$(($(date +%Y)-1))"
|
||||
yearMonth="$year-$precedingMonth"
|
||||
fi
|
||||
monthEnglish=$(LANG=en_EN.UTF-8;date -d $year-$precedingMonth-01 +%b)
|
||||
generateReport "$monthEnglish" "$year" "$yearMonth"
|
||||
elif [ "$#" -eq 2 ]; then
|
||||
if ! (let "$1") 2>/dev/null; then
|
||||
echo -e "Le mois doit être numérique."
|
||||
help
|
||||
echo -e "Le mois doit être numérique."
|
||||
help
|
||||
elif ([ "$1" -lt 1 ] || [ "$1" -gt 12 ]); then
|
||||
echo -e "Numéro du mois non valable $1."
|
||||
help
|
||||
echo -e "Numéro du mois non valable $1."
|
||||
help
|
||||
elif ! (let "$2") 2>/dev/null; then
|
||||
echo -e "L'année doit être numérique."
|
||||
help
|
||||
echo -e "L'année doit être numérique."
|
||||
help
|
||||
elif [ "$2" -lt 2018 ] || [ "$2" -gt "$(date +%Y)" ]; then
|
||||
echo -e "Année non valable $2."
|
||||
help
|
||||
echo -e "Année non valable $2."
|
||||
help
|
||||
elif [ "$2" -le 2017 ] || [ "$2" -ge $(($(date +%Y)+1)) ] ; then
|
||||
echo -e "Pas de données pour ce mois."
|
||||
help
|
||||
echo -e "Pas de données pour ce mois."
|
||||
help
|
||||
else
|
||||
if [ "$1" -lt 10 ]; then
|
||||
yearMonth="$2-0$1"
|
||||
else
|
||||
yearMonth="$2-$1"
|
||||
fi
|
||||
monthEnglish=$(LANG=en_EN.UTF-8;date -d "$2-$1-01" +%b)
|
||||
year="$2"
|
||||
generateReport "$monthEnglish" "$year" "$yearMonth"
|
||||
if [ "$1" -lt 10 ]; then
|
||||
yearMonth="$2-0$1"
|
||||
else
|
||||
yearMonth="$2-$1"
|
||||
fi
|
||||
monthEnglish=$(LANG=en_EN.UTF-8;date -d "$2-$1-01" +%b)
|
||||
year="$2"
|
||||
generateReport "$monthEnglish" "$year" "$yearMonth"
|
||||
fi
|
||||
elif [ "$#" -eq 0 ]; then
|
||||
yearMonth="$(date +%Y-%m)"
|
||||
|
Loading…
Reference in New Issue
Block a user