Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90998361
source_informations.sh.in
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Nov 6, 19:04
Size
877 B
Mime Type
text/x-shellscript
Expires
Fri, Nov 8, 19:04 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20019566
Attached To
rAKA akantu
source_informations.sh.in
View Options
#!/usr/bin/env bash
set -euo pipefail
GIT=@GIT_EXECUTABLE@
SOURCE_DIR=@PROJECT_SOURCE_DIR@
OUTPUT_FILE=@OUTPUT_FILE@
UUENCODE=@UUENCODE_EXECUTABLE@
set -x
GIT_VERSION=$(${GIT} describe --always --dirty)
GIT_BRANCH=$(${GIT} rev-parse --abbrev-ref --symbolic-full-name @)
GIT_REMOTE_BRANCH=$(${GIT} rev-parse --abbrev-ref --symbolic-full-name @{upstream})
GIT_REMOTE=$(git config branch.$GIT_BRANCH.remote)
GIT_REMOTE_URL=$(${GIT} config remote.$GIT_REMOTE.url)
GIT_DIFF=$(${GIT} diff @ | sed '1h;1!H;$!d;x;s/\n/\\n/g; s/'\''/\'\''/g; s/"/\\"/g')
set +x
cat <<EOF > ${OUTPUT_FILE}
#include <string>
auto @PROJECT_NAME@_GIT_VERSION = "${GIT_VERSION}";
auto @PROJECT_NAME@_GIT_BRANCH = "${GIT_BRANCH}";
auto @PROJECT_NAME@_GIT_REMOTE_BRANCH = "${GIT_REMOTE_BRANCH}";
auto @PROJECT_NAME@_GIT_REMOTE_URL = "${GIT_REMOTE_URL}";
auto @PROJECT_NAME@_GIT_DIFF = "${GIT_DIFF}";
EOF
Event Timeline
Log In to Comment