summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJoseph Herlant <aerostitch@users.noreply.github.com>2018-06-04 23:27:43 -0700
committerjkoan <jkoan@users.noreply.github.com>2018-06-05 08:27:43 +0200
commit5cb434fe13ca071d0eca38800519158013c96888 (patch)
tree091f0f6b04e28d335b38918ef1f4b672a4ab66e2 /scripts
parentfbb59e4739cd085706e0f045a0db53e3ec8bd695 (diff)
downloadnavit-5cb434fe13ca071d0eca38800519158013c96888.tar.gz
cleanup:scripts:Use $(..) instead of legacy `..` to make codefactor happy (#623)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/generate_contributors.sh4
-rw-r--r--scripts/import_translations.sh70
-rw-r--r--scripts/merge_i18n_update.sh2
-rw-r--r--scripts/xdotools.sh4
4 files changed, 40 insertions, 40 deletions
diff --git a/scripts/generate_contributors.sh b/scripts/generate_contributors.sh
index 619b0f862..43ef47c73 100644
--- a/scripts/generate_contributors.sh
+++ b/scripts/generate_contributors.sh
@@ -11,7 +11,7 @@ set -e
declare -A CONTRIBUTORS=()
declare -a authors=()
-TWO_YEARS_AGO=`date +%s --date="2 years ago"`
+TWO_YEARS_AGO=$(date +%s --date="2 years ago")
retiredTitleWritten=false
git log --encoding=utf-8 --full-history --date=short --use-mailmap "--format=format:%ad;%aN" |
@@ -20,7 +20,7 @@ git log --encoding=utf-8 --full-history --date=short --use-mailmap "--format=for
while read -r line; do
IFS=';'; arrLine=($line); unset IFS;
author=${arrLine[1]}
- commitDate=`date +%s --date="${arrLine[0]}"`
+ commitDate=$(date +%s --date="${arrLine[0]}")
# Exclude circleci
if [[ $author =~ [Cc]ircle[[:space:]]*[Cc][Ii] ]]; then
diff --git a/scripts/import_translations.sh b/scripts/import_translations.sh
index c934515e2..741c47200 100644
--- a/scripts/import_translations.sh
+++ b/scripts/import_translations.sh
@@ -6,42 +6,42 @@ set -e
# Let's fix the headers of the .po files in the import queue
for i in po/import_queue/*.po; do
- b=`basename $i`;
- po=${b#*-};
- code=${po%.*}
- git checkout -b i18n/$code
- lname=`head -n1 ${i} | sed 's/# \(.*\) translation.\{0,1\} for navit/\1/'`
- if [[ $lname == "" ]]; then
- echo "Cannot find the language name in the header of $i"
- exit 1
- fi
- d=`date +"%Y"`
- echo "# ${lname} translations for navit" > po/${po}.header
- echo "# Copyright (C) 2006-${d} The Navit Team" >> po/${po}.header
- echo "# This file is distributed under the same license as the navit package." >> po/${po}.header
- echo "# Many thanks to the contributors of this translation:" >> po/${po}.header
- # Build a clean list of the contributors
- IFS=$'\n'
- echo "Downloading https://translations.launchpad.net/navit/trunk/+pots/navit/${code}/+details"
- contributors=`wget -q https://translations.launchpad.net/navit/trunk/+pots/navit/${code}/+details -O - | grep -E '^ <a href=".+?" class="sprite person">'`
- for user in $contributors; do
- url=`echo $user|cut -d'"' -f2`
- name=`echo $user|cut -d'>' -f2|cut -d'<' -f1`
- echo "# $name $url" >> po/${po}.header
- done
- echo '' >> po/${po}.header
- echo 'msgid ""' >> po/${po}.header
+ b=$(basename $i)
+ po=${b#*-}
+ code=${po%.*}
+ git checkout -b i18n/$code
+ lname=$(head -n1 ${i} | sed 's/# \(.*\) translation.\{0,1\} for navit/\1/')
+ if [[ $lname == "" ]]; then
+ echo "Cannot find the language name in the header of $i"
+ exit 1
+ fi
+ d=$(date +"%Y")
+ echo "# ${lname} translations for navit" > po/${po}.header
+ echo "# Copyright (C) 2006-${d} The Navit Team" >> po/${po}.header
+ echo "# This file is distributed under the same license as the navit package." >> po/${po}.header
+ echo "# Many thanks to the contributors of this translation:" >> po/${po}.header
+ # Build a clean list of the contributors
+ IFS=$'\n'
+ echo "Downloading https://translations.launchpad.net/navit/trunk/+pots/navit/${code}/+details"
+ contributors=$(wget -q https://translations.launchpad.net/navit/trunk/+pots/navit/${code}/+details -O - | grep -E '^ <a href=".+?" class="sprite person">')
+ for user in $contributors; do
+ url=$(echo $user|cut -d'"' -f2)
+ name=$(echo $user|cut -d'>' -f2|cut -d'<' -f1)
+ echo "# $name $url" >> po/${po}.header
+ done
+ echo '' >> po/${po}.header
+ echo 'msgid ""' >> po/${po}.header
- # We remove two tags that just generate noise
- sed -i '/X-Launchpad-Export-Date/d' ${i}
- sed -i '/X-Generator/d' ${i}
- sed -i '/POT-Creation-Date/d' ${i}
+ # We remove two tags that just generate noise
+ sed -i '/X-Launchpad-Export-Date/d' ${i}
+ sed -i '/X-Generator/d' ${i}
+ sed -i '/POT-Creation-Date/d' ${i}
- # Let's put the translation from launchpad without the header
- mv po/${po}.header po/${po}.in
- sed '1,/msgid ""/ d' ${i} >> po/${po}.in
+ # Let's put the translation from launchpad without the header
+ mv po/${po}.header po/${po}.in
+ sed '1,/msgid ""/ d' ${i} >> po/${po}.in
- git add po/${po}.in && rm $i
- git commit -m "Updated ${lname} translation from launchpad" po/${po}.in
- git push --set-upstream origin i18n/${code}
+ git add po/${po}.in && rm $i
+ git commit -m "Updated ${lname} translation from launchpad" po/${po}.in
+ git push --set-upstream origin i18n/${code}
done
diff --git a/scripts/merge_i18n_update.sh b/scripts/merge_i18n_update.sh
index 5fb42d56e..bb0715d5b 100644
--- a/scripts/merge_i18n_update.sh
+++ b/scripts/merge_i18n_update.sh
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-message=`git log -1 --pretty=%B`
+message=$(git log -1 --pretty=%B)
git config --global user.name "CircleCI"
git config --global user.email circleci@navit-project.org
git rebase trunk
diff --git a/scripts/xdotools.sh b/scripts/xdotools.sh
index 143a36ee7..a9fa65e8d 100644
--- a/scripts/xdotools.sh
+++ b/scripts/xdotools.sh
@@ -11,7 +11,7 @@ LOGS_DIR=$CIRCLE_ARTIFACTS/logs_${1}
event=0
send_event (){
- file=`printf "%05d\n" $event`
+ file=$(printf "%05d\n" $event)
import -window root $FRAME_DIR/tmp.png
if [[ "$1" == "mousemove" ]]; then
@@ -82,7 +82,7 @@ send_event key KP_Enter # Validate
# Send 'Berk'
# capture 5 seconds of usage
-for i in `seq 99994 99999`; do
+for i in $(seq 99994 99999); do
import -window root $FRAME_DIR/${i}.png
sleep 1
done