You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by an...@apache.org on 2020/10/12 10:59:19 UTC
[zookeeper] branch master updated: ZOOKEEPER-3955: added a shebang
or a 'shell' directive to lastRevision.sh
This is an automated email from the ASF dual-hosted git repository.
andor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zookeeper.git
The following commit(s) were added to refs/heads/master by this push:
new fae62f5 ZOOKEEPER-3955: added a shebang or a 'shell' directive to lastRevision.sh
fae62f5 is described below
commit fae62f521a5cf36e2d35f5646aa34d2ed3ae3415
Author: championquizzer <jo...@gmail.com>
AuthorDate: Mon Oct 12 12:59:11 2020 +0200
ZOOKEEPER-3955: added a shebang or a 'shell' directive to lastRevision.sh
1. Added the shebang
2. Added $(...) notation instead of legacy backticked `...`
3. Added double quote to prevent globbing and word splitting
Author: championquizzer <jo...@gmail.com>
Reviewers: eolivelli@apache.org, andor@apache.org
Closes #1472 from championquizzer/newbranch
---
zookeeper-server/src/main/resources/lastRevision.sh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/zookeeper-server/src/main/resources/lastRevision.sh b/zookeeper-server/src/main/resources/lastRevision.sh
index 0690c7d..ec16784 100755
--- a/zookeeper-server/src/main/resources/lastRevision.sh
+++ b/zookeeper-server/src/main/resources/lastRevision.sh
@@ -1,3 +1,4 @@
+#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
@@ -16,6 +17,6 @@
# Find the current revision, store it in a file
FILE=$1
-LASTREV=`git rev-parse HEAD`
+LASTREV=$(git rev-parse HEAD)
-echo "lastRevision=${LASTREV}" > $FILE
+echo "lastRevision=${LASTREV}" > "$FILE"