duckstation

duckstation, but archived from the revision just before upstream changed it to a proprietary software project, this version is the libre one
git clone https://git.neptards.moe/u3shit/duckstation.git
Log | Files | Refs | README | LICENSE

generate-metainfo.sh (839B)


      1 #!/usr/bin/env bash
      2 
      3 SCRIPTDIR=$(realpath $(dirname "${BASH_SOURCE[0]}"))
      4 
      5 if [[ $# -lt 1 ]]; then
      6 	echo "Output directory must be provided as a parameter"
      7 	exit 1
      8 fi
      9 
     10 APPID="org.duckstation.DuckStation"
     11 OUTDIR=$(realpath "$1")
     12 OUTFILE="${OUTDIR}/${APPID}.metainfo.xml"
     13 
     14 pushd "${SCRIPTDIR}" >/dev/null
     15 GIT_DATE=$(git log -1 --pretty=%cd --date=short)
     16 GIT_HASH=$(git rev-parse HEAD)
     17 GIT_VERSION=$(git describe --dirty | tr -d '\r\n')
     18 if [[ "${GIT_VERSION}" == "" ]]; then
     19 	GIT_VERSION=$(git rev-parse HEAD)
     20 fi
     21 
     22 popd >/dev/null
     23 
     24 echo "GIT_DATE: ${GIT_DATE}"
     25 echo "GIT_VERSION: ${GIT_VERSION}"
     26 echo "GIT_HASH: ${GIT_HASH}"
     27 
     28 cp "${SCRIPTDIR}/${APPID}.metainfo.xml.in" "${OUTFILE}"
     29 
     30 sed -i -e "s/@GIT_VERSION@/${GIT_VERSION}/" "${OUTFILE}"
     31 sed -i -e "s/@GIT_DATE@/${GIT_DATE}/" "${OUTFILE}"
     32 sed -i -e "s/@GIT_HASH@/${GIT_HASH}/" "${OUTFILE}"
     33