Newer
Older
remove_pip_metadata() {
find . -type d -name pip-wheel-metadata -print0 | xargs -0r rm -rf --
}
remove_pip_metadata
poetry install
for d in apps/official/*; do
remove_pip_metadata
poetry run sh -c "cd $d; poetry lock; poetry install"
remove_pip_metadata
poetry run ./manage.py compilemessages
poetry run ./manage.py yarn install
poetry run ./manage.py collectstatic --no-input
cd "$(dirname "$0")"
manage_py=$(realpath manage.py)
locales="-l ar -l de_DE -l fr -l nb_NO -l tr_TR -l la"
for d in aleksis/core apps/official/*/aleksis/apps/*; do
echo; echo "Entering $d."
poetry run sh -c "cd $d; $manage_py makemessages --no-wrap -e html,txt,py,email -i static $locales"
poetry run sh -c "cd $d; $manage_py makemessages --no-wrap -d djangojs $locales"
for d in aleksis/core apps/official/*/aleksis/apps/*; do
echo; echo "Entering $d."
poetry run sh -c "cd $d; autopep8 -i -r ."
done
cd "$(dirname "$0")"
tox_ini=$(realpath tox.ini)
for d in aleksis/core apps/official/*/aleksis/apps/*; do
echo; echo "Entering $d."
poetry run sh -c "cd $d; pylama -a -o $tox_ini ."
done
gource --output-custom-log - "$d"
done | sort -n | gource --log-format custom --background-image aleksis/core/static/img/aleksis-icon.png "$@" -
"devstats-commits")
# Copyright © 2018
# mirabilos <m@mirbsd.org>
# Copyright © 2017
# mirabilos <t.glaser@tarent.de>
# Copyright © 2015, 2017, 2020
# mirabilos <thorsten.glaser@teckids.org>
#
# Provided that these terms and disclaimer and all copyright notices
# are retained or reproduced in an accompanying document, permission
# is granted to deal in this work without restriction, including un‐
# limited rights to use, publicly perform, distribute, sell, modify,
# merge, give away, or sublicence.
#
# This work is provided “AS IS” and WITHOUT WARRANTY of any kind, to
# the utmost extent permitted by applicable law, neither express nor
# implied; without malicious intent or gross negligence. In no event
# may a licensor, author or contributor be held liable for indirect,
# direct, other damage, loss, or other issues arising in any way out
# of dealing in the work, even if advised of the possibility of such
# damage or existence of a defect, except proven that it results out
# of said person’s immediate fault when using the work as intended.
set -e
set -o pipefail
unset LANGUAGE
export LC_ALL=C.UTF-8
set -o utf8-mode
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
for d in . apps/official/*; do
cd "$d"
if [[ ! -s pyproject.toml ]]; then
print -ru2 "E: missing pyproject.toml in ${d@Q}"
print -ru2 "N: maybe you forgot the submodules?"
print -ru2 "N: try git submodule update --init --recursive"
exit 1
fi
cd "$OLDPWD"
done
for d in . apps/official/*; do
cd "$d"
git log --pretty=tformat:%aN
cd "$OLDPWD"
done | sort | uniq -c | sort -nr |&
maxnum=0
maxlen=0
set -A nums
set -A names
nlines=0
while IFS= read -pr line; do
line=${line##*( )}
num=${line%% *}
line=${line##+([0-9]) }
#print -r -- "<$num><$line>"
(( maxnum = num > maxnum ? num : maxnum ))
len=${%line}
if (( len == -1 )); then
len=${#line}
print -ru2 -- "W: assuming length $len for author ${line@Q}"
fi
(( maxlen = len > maxlen ? len : maxlen ))
nums[nlines]=$num
names[nlines++]=$line
done
w=$COLUMNS
if (( (w -= 1 + maxlen + 1) < 1 )); then
print -ru2 -- "E: terminal too small, need $((-w+1)) more columns"
exit 1
fi
if (( maxnum < 1 )); then
print -ru2 -- "E: no commits"
exit 1
fi
set +e
typeset -R$maxlen pname
mbar=██
nlen=0
num=$maxnum
while ((# num > 0 )); do
mbar+=█
((# ++nlen ))
((# num /= 10 ))
done
typeset -R$nlen pnum
print '\e[0m'
line=-1
while (( ++line < nlines )); do
bar=
((# num = (nums[line] * w * 8) / maxnum ))
while ((# num >= 8 )); do
bar+=█
((# num -= 8 ))
done
case $num {
(7) bar+=▉ ;;
(6) bar+=▊ ;;
(5) bar+=▋ ;;
(4) bar+=▌ ;;
(3) bar+=▍ ;;
(2) bar+=▎ ;;
(1) bar+=▏ ;;
}
pname=${names[line]}
if [[ $bar = "$mbar"* ]]; then
pnum=${nums[line]}
bar=$'\e[7m '$pnum$' \e[0m'${bar#"$mbar"}
else
bar+=" ${nums[line]}"
fi
print -r -- "$pname $bar"
done
exit
;;
print -ru2 -- "E: unknown command ${1@Q}"
exit 1