Skip to content

Commit e225e76

Browse files
committed
less repetition in script fixing pt root keys
1 parent ea29240 commit e225e76

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/usr/bin/env bash
22

3-
echo "Fixing language root key in pt-BR and pt-PT crowdin files to match the filename"
43
if [ "$(uname -s)" = "Darwin" ]; then
5-
sed -i '' 's/^pt:/pt-BR:/' config/locales/crowdin/*pt-BR*.yml modules/*/config/locales/crowdin/*pt-BR*.yml
6-
sed -i '' 's/^pt:/pt-PT:/' config/locales/crowdin/*pt-PT*.yml modules/*/config/locales/crowdin/*pt-PT*.yml
4+
sed-i() { sed -i '' "$@"; }
75
else
8-
sed -i 's/^pt:/pt-BR:/' config/locales/crowdin/*pt-BR*.yml modules/*/config/locales/crowdin/*pt-BR*.yml
9-
sed -i 's/^pt:/pt-PT:/' config/locales/crowdin/*pt-PT*.yml modules/*/config/locales/crowdin/*pt-PT*.yml
6+
sed-i() { sed -i "$@"; }
107
fi
8+
9+
echo "Fixing language root key in pt-BR and pt-PT crowdin files to match the filename"
10+
sed-i 's/^pt:/pt-BR:/' config/locales/crowdin/*pt-BR*.yml modules/*/config/locales/crowdin/*pt-BR*.yml
11+
sed-i 's/^pt:/pt-PT:/' config/locales/crowdin/*pt-PT*.yml modules/*/config/locales/crowdin/*pt-PT*.yml

0 commit comments

Comments
 (0)