diff options
author | Jannis M. Hoffmann <jannis.hoffmann@rwth-aachen.de> | 2022-05-09 01:15:07 +0200 |
---|---|---|
committer | Jannis M. Hoffmann <jannis.hoffmann@rwth-aachen.de> | 2022-05-09 01:15:07 +0200 |
commit | de941df4cb8ef4f95563ef818380f870f442f7cd (patch) | |
tree | 3c5e491fd1e863d1688459ed6873d3730d7fb803 | |
parent | 850b160f38bc639325f960bf6a73b83d8120f9bf (diff) |
add rule to actions to gather translatable snippets
-rwxr-xr-x | actions.sh | 31 |
1 files changed, 23 insertions, 8 deletions
@@ -6,7 +6,8 @@ help_text= help_text="$help_text run_tests\t[arg]\tpasses arg to the 'prove' tool\n" run_tests () { - eval "prove -l ${1-} t/" + #eval "prove -l ${1-} t/" + make test } help_text="$help_text start_dev\t[]\tstarts a hot reloading dev server\n" @@ -14,7 +15,7 @@ start_dev () { morbo script/jwebmail } -help_text="$help_text logrotate\t[mode]\tarives the current log file\n" +help_text="$help_text logrotate\t[mode]\tarchives the current log file\n" logrotate () { mode=${1:-development} mv -i "log/$mode.log" "log/${mode}_$(date --iso-8601=minutes).log" @@ -37,10 +38,11 @@ follow () { help_text="$help_text check_manifest\t[]\tchecks if files in the MANIFEST actually exist\n" check_manifest () { - perl -nE 'chomp; say unless -e' MANIFEST + #perl -nE 'chomp; say unless -e' MANIFEST + make ci } -help_text="$help_text list_deps\t[]\tlists all non core dependencies\n" +help_text="$help_text list_deps\t[module]\tlists all non core dependencies of a module (default=JWebmail)\n" list_deps () { module=${1:-JWebmail} core="$(corelist -v v5.34.1 | awk '{ print $1 }')" @@ -48,17 +50,30 @@ list_deps () { for dep in $deps do - if echo "$core" | grep -qxF "$dep" - then : - else echo "$dep" + if ! echo "$core" | grep -qxF "$dep" + then echo "$dep" fi done } +help_text="$help_text list_translations\t[raw]\tlists translatable snipptes on a best effort base (incomplete!!)\n" +list_translations () { + raw=${1-} + if [ "$raw" ] + then + find lib -name '*.pm' -exec grep '\->l(' '{}' '+' + find templates -name '*.html.ep' -exec grep "l[ (][\"']" '{}' '+' + else + p1="$(find lib -name '*.pm' -exec grep '\->l(' '{}' '+' | sed 's/^\(\S*\):.*->l(\([^)]*\)).*$/\1: \2/')" + p2="$(find templates -name '*.html.ep' -exec grep "l[ (][\"']" '{}' '+' | sed "s/^\\(\\S*\\):.*l[ (][\"']\\([^\"']*\\)[\"'].*$/\\1: '\\2'/")" + echo "$(echo "$p1"; echo "$p2")" | sort | uniq + fi +} + help () { echo "The following actions are available:" echo - printf "$help_text" | expand -t 19,29 + printf "$help_text" | expand -t 22,33 echo } |