aboutsummaryrefslogtreecommitdiff
path: root/dev/lib/handlebars/scripts/update_upstream_git_hash.sh
blob: 52cc39e0d7bb39c44b75f658ba27760da863484d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash

set -e

TMP=.tmp-handlebars
HASH_FILE=packages/kbn-handlebars/src/spec/.upstream_git_hash

function cleanup {
  rm -fr $TMP
}

trap cleanup EXIT

rm -fr $TMP
mkdir $TMP

echo "Cloning handlebars repo..."
git clone -q --depth 1 https://github.com/handlebars-lang/handlebars.js.git -b 4.x $TMP

echo "Updating hash file..."
git -C $TMP rev-parse HEAD | tr -d '\n' > $HASH_FILE
git add $HASH_FILE

echo "Done! - Don't forget to commit any changes to $HASH_FILE"