diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2014-11-24 21:44:48 +0100 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2014-11-24 21:47:40 +0100 |
| commit | 75ca70852b9820a545da9594e76865e2db2950c5 (patch) | |
| tree | 1de52012e48a28e96963a63f25eda10279a98608 /crowdin/globals | |
| parent | cbe5cf089d71e5742cc40637c380cde3e04e5505 (diff) | |
| download | cgeo-75ca70852b9820a545da9594e76865e2db2950c5.zip cgeo-75ca70852b9820a545da9594e76865e2db2950c5.tar.gz cgeo-75ca70852b9820a545da9594e76865e2db2950c5.tar.bz2 | |
Fix crowdin local patches application
Also use stackable bash subshells instead of backquotes.
Diffstat (limited to 'crowdin/globals')
| -rwxr-xr-x | crowdin/globals | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/crowdin/globals b/crowdin/globals index dc2e9c9..80f7e83 100755 --- a/crowdin/globals +++ b/crowdin/globals @@ -1,8 +1,10 @@ #!/bin/bash -. "`dirname $0`/credentials" +progdir=$(cd $(dirname "$0") && pwd) -OUT=/tmp/crowdin.`basename $0`.`date +%Y-%m-%d.%H:%M:%S`.out +. "$progdir/credentials" + +OUT=/tmp/crowdin.$(basename $0).$(date +%Y-%m-%d.%H:%M:%S).out crowdin_surf () { _do curl -o "${OUT}" $@ || die "curl produced an error." @@ -15,7 +17,7 @@ require_tools () { # code taken from backup2l local NOT_AVAIL="" for TOOL in $@; do - if [ "`which $TOOL 2> /dev/null`" == "" ]; then NOT_AVAIL="$NOT_AVAIL $TOOL"; fi + if [ "$(which $TOOL 2> /dev/null)" == "" ]; then NOT_AVAIL="$NOT_AVAIL $TOOL"; fi done if [[ "$NOT_AVAIL" != "" ]]; then die "The following required tool(s) cannot be found: $NOT_AVAIL" @@ -32,7 +34,7 @@ map_to_crowdin_code () { finish () { : ; } die () { for i; do debug "$i"; done; finish; exit 1; } -debug () { echo "`date +%Y-%m-%d.%H:%M:%S` `basename $0`: $@"; } +debug () { echo $(date +%Y-%m-%d.%H:%M:%S) $(basename $0): $@; } # use this function for executing commands. _do () { debug "$@"; eval "$@"; } @@ -40,5 +42,4 @@ _do () { debug "$@"; eval "$@"; } require_tools git curl wget unzip sed git rev-parse --show-toplevel >& /dev/null || die "Please start this script from within a repo. Aborting." -cd "`git rev-parse --show-toplevel`" - +cd "$(git rev-parse --show-toplevel)" |
