File: get_last_commit_year.sh

package info (click to toggle)
darktable 4.2.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 52,960 kB
  • sloc: ansic: 329,632; cpp: 90,717; xml: 18,803; lisp: 12,673; sh: 3,478; javascript: 3,264; perl: 1,888; python: 1,082; ruby: 972; makefile: 536; asm: 46; sql: 38; awk: 21
file content (15 lines) | stat: -rwxr-xr-x 289 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

DT_SRC_DIR=$(dirname "$0")
DT_SRC_DIR=$(cd "$DT_SRC_DIR/../" && pwd -P)

LAST_COMMIT_YEAR=$(git --git-dir="${DT_SRC_DIR}/.git" log -n1 --pretty=%ci)

if [ $? -eq 0 ]; then
  echo "${LAST_COMMIT_YEAR}" | cut -b 1-4
  exit 0
fi

# fallback in case git above failed

date -u "+%Y"