seperate GIT_TAG and GIT_HASH in version.c
This commit is contained in:
@@ -2,16 +2,20 @@
|
|||||||
|
|
||||||
# Script to generate version information file
|
# Script to generate version information file
|
||||||
|
|
||||||
|
# Current git hash
|
||||||
|
HASH="$(git describe --always --dirty)"
|
||||||
|
|
||||||
# Current git tag
|
# Current git tag
|
||||||
TAG="$(git describe --always --dirty --tags)"
|
TAG="$(git describe --always --dirty --tags)"
|
||||||
|
|
||||||
# Output filename
|
# Output filename
|
||||||
OUTFILE='src/version.c'
|
OUTFILE='src/version.c'
|
||||||
|
|
||||||
sed -e "s/<HASH>/$TAG/g" <<EOF > "$OUTFILE"
|
sed -e "s/<HASH>/$HASH/g" -e "s/<TAG>/$TAG/g" <<EOF > "$OUTFILE"
|
||||||
/* Build version information. This file generated by genver.sh */
|
/* Build version information. This file generated by genver.sh */
|
||||||
|
|
||||||
const char GIT_HASH[] = "<HASH>";
|
const char GIT_HASH[] = "<HASH>";
|
||||||
|
const char GIT_TAG[] = "<TAG>";
|
||||||
const char CC_VERSION[] = __VERSION__;
|
const char CC_VERSION[] = __VERSION__;
|
||||||
const char BUILD_DATE[] = __DATE__;
|
const char BUILD_DATE[] = __DATE__;
|
||||||
EOF
|
EOF
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <curses.h>
|
#include <curses.h>
|
||||||
#include "screens.h"
|
#include "screens.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
void draw_home(struct Screen *screen, char *input) {
|
void draw_home(struct Screen *screen, char *input) {
|
||||||
static char* banner = ""
|
static char* banner = ""
|
||||||
@@ -17,4 +18,8 @@ void draw_home(struct Screen *screen, char *input) {
|
|||||||
mvwprintw(screen->win, 1, 2, "Thank you for visiting:");
|
mvwprintw(screen->win, 1, 2, "Thank you for visiting:");
|
||||||
mvwprintw(screen->win, 2, 1, "%s", banner);
|
mvwprintw(screen->win, 2, 1, "%s", banner);
|
||||||
mvwprintw(screen->win, 10, 1, "Your current input is: %s", input);
|
mvwprintw(screen->win, 10, 1, "Your current input is: %s", input);
|
||||||
|
mvwprintw(screen->win, 11, 1, "Git hash: %s", GIT_HASH);
|
||||||
|
mvwprintw(screen->win, 12, 1, "Git tag: %s", GIT_TAG);
|
||||||
|
mvwprintw(screen->win, 13, 1, "CC version: %s", CC_VERSION);
|
||||||
|
mvwprintw(screen->win, 14, 1, "Build date: %s", BUILD_DATE);
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
/* Header for version information constants */
|
/* Header for version information constants */
|
||||||
|
|
||||||
extern const char GIT_HASH[];
|
extern const char GIT_HASH[];
|
||||||
|
extern const char GIT_TAG[];
|
||||||
extern const char CC_VERSION[];
|
extern const char CC_VERSION[];
|
||||||
extern const char BUILD_DATE[];
|
extern const char BUILD_DATE[];
|
||||||
|
Reference in New Issue
Block a user