zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an...@apache.org
Subject [zookeeper] branch branch-3.6 updated: ZOOKEEPER-3955: added a shebang or a 'shell' directive to lastRevision.sh
Date Mon, 12 Oct 2020 10:59:34 GMT
This is an automated email from the ASF dual-hosted git repository.

andor pushed a commit to branch branch-3.6
in repository https://gitbox.apache.org/repos/asf/zookeeper.git


The following commit(s) were added to refs/heads/branch-3.6 by this push:
     new 7cc7c12  ZOOKEEPER-3955: added a shebang or a 'shell' directive to lastRevision.sh
7cc7c12 is described below

commit 7cc7c12bc6bf374fc2eb9bec085591e2f9014e38
Author: championquizzer <joydeep09@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 <joydeep09@gmail.com>
    
    Reviewers: eolivelli@apache.org, andor@apache.org
    
    Closes #1472 from championquizzer/newbranch
    
    (cherry picked from commit fae62f521a5cf36e2d35f5646aa34d2ed3ae3415)
    Signed-off-by: Andor Molnar <andor@apache.org>
---
 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"


Mime
View raw message