forked from WeblateOrg/meta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sync.sh
executable file
·72 lines (58 loc) · 2.12 KB
/
sync.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh
set -u -e
REPOS="customize-example wlc scripts fedora_messaging weblate website weblate_schemas translation-finder munin fail2ban docker docker-compose hosted wllegal language-data graphics helm siphashc"
INITFILES="requirements-lint.txt .pre-commit-config.yaml .github/dependabot.yml"
COPYFILES=".github/stale.yml .github/labels.yml .github/workflows/closing.yml .github/workflows/labels.yml .github/workflows/label-sync.yml .github/workflows/pre-commit.yml .github/workflows/pull_requests.yaml .github/FUNDING.yml .github/.kodiak.toml .yamllint.yml SECURITY.md"
PRESENTFILES=".github/workflows/super-linter.yml .github/matchers/sphinx-linkcheck.json .github/matchers/sphinx.json .github/matchers/flake8.json .github/matchers/eslint-compact.json .github/workflows/flake8.yml .github/workflows/eslint.yml .github/workflows/stylelint.yml .eslintrc.yml .stylelintrc"
if [ -f .venv/bin/activate ] ; then
# shellcheck disable=SC1091
. .venv/bin/activate
else
echo "Missing virtualenv in .venv!"
exit 1
fi
ROOT=$PWD
mkdir -p repos
cd repos
for repo in $REPOS ; do
if [ ! -d "$repo" ] ; then
git clone "[email protected]:WeblateOrg/$repo.git"
cd "$repo"
else
cd "$repo"
git reset --quiet --hard origin/master
git pull --quiet
fi
echo "== $repo =="
# Check README
if ! grep -q Logo-Darktext-borders.png README.* 2>/dev/null ; then
echo "WARNING: README does not containing logo."
fi
# Update files
mkdir -p .github/workflows/
for file in $INITFILES ; do
if [ ! -f "$file" ] ; then
cp "../../$file" "$file"
fi
done
for file in $COPYFILES ; do
cp "../../$file" "$file"
done
for file in $PRESENTFILES ; do
if [ -f "$file" ] ; then
cp "../../$file" "$file"
fi
done
# Pre-commit update
pre-commit autoupdate
# Generate dependabot configuration
"$ROOT/generate-dependabot"
# Update issue templates
"$ROOT/update-issue-config" "$ROOT"
# Add and push
git add .
git commit -m 'Sync with WeblateOrg/meta'
git push
echo
cd ..
done