fix shellcheck failures of hack/update-gofmt.sh hack/update-translations.sh

k3s-v1.15.3
SataQiu 2019-04-09 12:30:58 +08:00
parent fbc28fd15f
commit 0f09703c48
3 changed files with 7 additions and 9 deletions

View File

@ -48,9 +48,7 @@
./hack/update-generated-kms-dockerized.sh
./hack/update-generated-protobuf-dockerized.sh
./hack/update-generated-runtime-dockerized.sh
./hack/update-gofmt.sh
./hack/update-openapi-spec.sh
./hack/update-translations.sh
./hack/update-vendor-licenses.sh
./hack/update-vendor.sh
./hack/verify-api-groups.sh

View File

@ -20,7 +20,7 @@ set -o errexit
set -o nounset
set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::verify_go_version
@ -44,4 +44,4 @@ find_files() {
}
GOFMT="gofmt -s -w"
find_files | xargs ${GOFMT}
find_files | xargs "${GOFMT}"

View File

@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/util.sh"
KUBECTL_FILES="pkg/kubectl/cmd/*.go pkg/kubectl/cmd/*/*.go"
@ -61,7 +61,7 @@ fi
if [[ "${generate_pot}" == "true" ]]; then
echo "Extracting strings to POT"
go-xgettext -k=i18n.T ${KUBECTL_FILES} > tmp.pot
go-xgettext -k=i18n.T "${KUBECTL_FILES}" > tmp.pot
perl -pi -e 's/CHARSET/UTF-8/' tmp.pot
perl -pi -e 's/\\\(/\\\\\(/g' tmp.pot
perl -pi -e 's/\\\)/\\\\\)/g' tmp.pot
@ -78,10 +78,10 @@ fi
if [[ "${generate_mo}" == "true" ]]; then
echo "Generating .po and .mo files"
for x in translations/*/*/*/*.po; do
msgcat -s ${x} > tmp.po
mv tmp.po ${x}
msgcat -s "${x}" > tmp.po
mv tmp.po "${x}"
echo "generating .mo file for: ${x}"
msgfmt ${x} -o "$(dirname ${x})/$(basename ${x} .po).mo"
msgfmt "${x}" -o "$(dirname "${x}")/$(basename "${x}" .po).mo"
done
fi