github.com/elopio/cli@v6.21.2-0.20160902224010-ea909d1fdb2f+incompatible/bin/newextract (about)

     1  #!/usr/bin/env bash
     2  
     3  set -ex
     4  
     5  mkdir lang_temp
     6  
     7  IGNORE_FILES_REGEX=".*test.go|.*resources.go|fake.*\.go|template.go"
     8  
     9  i18n4go -c extract-strings -e excluded.json -s specialStrings.json -o lang_temp -d commands -r --ignore-regexp $IGNORE_FILES_REGEX
    10  i18n4go -c extract-strings -e excluded.json -s specialStrings.json -o lang_temp -d cf -r --ignore-regexp $IGNORE_FILES_REGEX
    11  i18n4go -c merge-strings -v -d lang_temp
    12  
    13  i18n4go -c fixup --source-language-file lang_temp/en.all.json
    14  
    15  set +e
    16  
    17  goi18n -outdir cf/i18n/resources cf/i18n/resources/*.all.json
    18  if [ $? -ne 0 ]; then
    19    printf "Failed to run `goi18n -outdir cf/i18n/resources cf/i18n/resources/*.all.json`"
    20    exit 1
    21  fi
    22  
    23  if [[ $(git status --porcelain cf/i18n/resources) ]]; then
    24    bin/generate-language-resources
    25    if [ $? -ne 0 ]; then
    26      printf "Failed to run `bin/generate-language-resources`"
    27      exit 1
    28    fi
    29  fi
    30  
    31  rm -rf lang_temp