Skip to content

Commit 0f09703

Browse files
committed
fix shellcheck failures of hack/update-gofmt.sh hack/update-translations.sh
1 parent fbc28fd commit 0f09703

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

hack/.shellcheck_failures

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@
4848
./hack/update-generated-kms-dockerized.sh
4949
./hack/update-generated-protobuf-dockerized.sh
5050
./hack/update-generated-runtime-dockerized.sh
51-
./hack/update-gofmt.sh
5251
./hack/update-openapi-spec.sh
53-
./hack/update-translations.sh
5452
./hack/update-vendor-licenses.sh
5553
./hack/update-vendor.sh
5654
./hack/verify-api-groups.sh

hack/update-gofmt.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ set -o errexit
2020
set -o nounset
2121
set -o pipefail
2222

23-
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
23+
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
2424
source "${KUBE_ROOT}/hack/lib/init.sh"
2525

2626
kube::golang::verify_go_version
@@ -44,4 +44,4 @@ find_files() {
4444
}
4545

4646
GOFMT="gofmt -s -w"
47-
find_files | xargs ${GOFMT}
47+
find_files | xargs "${GOFMT}"

hack/update-translations.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
17+
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
1818
source "${KUBE_ROOT}/hack/lib/util.sh"
1919

2020
KUBECTL_FILES="pkg/kubectl/cmd/*.go pkg/kubectl/cmd/*/*.go"
@@ -61,7 +61,7 @@ fi
6161

6262
if [[ "${generate_pot}" == "true" ]]; then
6363
echo "Extracting strings to POT"
64-
go-xgettext -k=i18n.T ${KUBECTL_FILES} > tmp.pot
64+
go-xgettext -k=i18n.T "${KUBECTL_FILES}" > tmp.pot
6565
perl -pi -e 's/CHARSET/UTF-8/' tmp.pot
6666
perl -pi -e 's/\\\(/\\\\\(/g' tmp.pot
6767
perl -pi -e 's/\\\)/\\\\\)/g' tmp.pot
@@ -78,10 +78,10 @@ fi
7878
if [[ "${generate_mo}" == "true" ]]; then
7979
echo "Generating .po and .mo files"
8080
for x in translations/*/*/*/*.po; do
81-
msgcat -s ${x} > tmp.po
82-
mv tmp.po ${x}
81+
msgcat -s "${x}" > tmp.po
82+
mv tmp.po "${x}"
8383
echo "generating .mo file for: ${x}"
84-
msgfmt ${x} -o "$(dirname ${x})/$(basename ${x} .po).mo"
84+
msgfmt "${x}" -o "$(dirname "${x}")/$(basename "${x}" .po).mo"
8585
done
8686
fi
8787

0 commit comments

Comments
 (0)