Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90775874
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
Mon, Nov 4, 15:43
Size
877 B
Mime Type
text/x-shellscript
Expires
Wed, Nov 6, 15:43 (2 d)
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