zulip/tools/setup/download-zxcvbn

24 lines
561 B
Bash
Executable File

#!/usr/bin/env bash
set -e
set -x
output_path=static/third/zxcvbn
commit_file_path=$output_path/commit
commit=0890678ede1488ecb02cda7eb793cd308a59c49d # Change this to upgrade
mkdir -p "$output_path"
if [ -e "$commit_file_path" ]
then
current_commit=`cat $commit_file_path`
else
current_commit=00
fi
if [ "$current_commit" == "$commit" ]; then
echo "Already at latest version of zxcvbn.js"
else
echo "$commit" > "$commit_file_path"
wget "https://raw.githubusercontent.com/dropbox/zxcvbn/$commit/zxcvbn.js" -O "$output_path/zxcvbn.js"
fi