Browse Source

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
championquizzer 4 years ago
parent
commit
fae62f521a
1 changed files with 3 additions and 2 deletions
  1. 3 2
      zookeeper-server/src/main/resources/lastRevision.sh

+ 3 - 2
zookeeper-server/src/main/resources/lastRevision.sh

@@ -1,3 +1,4 @@
+#!/bin/sh
 # Licensed to the Apache Software Foundation (ASF) under one
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
 # distributed with this work for additional information
@@ -16,6 +17,6 @@
 
 
 # Find the current revision, store it in a file
 # Find the current revision, store it in a file
 FILE=$1
 FILE=$1
-LASTREV=`git rev-parse HEAD`
+LASTREV=$(git rev-parse HEAD)
 
 
-echo "lastRevision=${LASTREV}" > $FILE
+echo "lastRevision=${LASTREV}" > "$FILE"