Created
May 13, 2018 20:58
-
-
Save muukii/cc655b0cf0d7986421725a5493c7f3d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !/bin/sh | |
set -e | |
target_dir="${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" | |
mkdir -p $target_dir | |
last_commit_log=`git --git-dir ${SRCROOT}/.git log HEAD --oneline -n 1` | |
current_branch=`git --git-dir ${SRCROOT}/.git rev-parse --abbrev-ref HEAD 2> /dev/null` | |
last_commit_hash=`git --git-dir ${SRCROOT}/.git rev-parse HEAD` | |
json_file="build_info.json" | |
json_path="${target_dir}/${json_file}" | |
echo "Generate to ${json_path}" | |
touch $json_path | |
cat << EOM > ${json_path} | |
{ | |
"current_branch" : "$current_branch", | |
"last_commit_hash" : "$last_commit_hash", | |
"last_commit_log" : "$last_commit_log", | |
"build_configuration" : "$CONFIGURATION", | |
"built_at" : "`date '+%Y/%m/%d %r'`" | |
} | |
EOM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment