1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

Fix sed binary call with variable (#1707)

* Use variable instead of binary name

* Use variable for sed
This commit is contained in:
nomoo 2022-09-13 23:41:41 +03:00 committed by GitHub
parent 858d6c030c
commit 0b72ff2a74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -3,12 +3,13 @@
DIR=$1 DIR=$1
FILE=$2 FILE=$2
GIT=$(which git) GIT=$(which git)
SED=$(which sed)
if [ -d "${DIR}/.git/" ] && [ -n "${GIT}" ] if [ -d "${DIR}/.git/" ] && [ -n "${GIT}" ]
then then
echo -n "#define GIT_VERSION \"" > "${FILE}.tmp" echo -n "#define GIT_VERSION \"" > "${FILE}.tmp"
BRTG="$(${GIT} describe --tags --always --all | sed -e 's:heads/::')" BRTG="$(${GIT} describe --tags --always --all | ${SED} -e 's:heads/::')"
REV="$(${GIT} describe --tags --always --dirty| sed -e 's:-g\([a-f0-9]\{7\}\):-git-\1:g')" REV="$(${GIT} describe --tags --always --dirty| ${SED} -e 's:-g\([a-f0-9]\{7\}\):-git-\1:g')"
echo -n "${REV} (${BRTG})" >> "${FILE}.tmp" echo -n "${REV} (${BRTG})" >> "${FILE}.tmp"
echo "\"" >> "${FILE}.tmp" echo "\"" >> "${FILE}.tmp"
else else

View file

@ -103,7 +103,7 @@ create_config_copy()
{ {
${ROFI} -dump-config > "${TMP_CONFIG_FILE}" ${ROFI} -dump-config > "${TMP_CONFIG_FILE}"
# remove theme entry. # remove theme entry.
sed -i 's/^\s*theme:\s\+".*"\s*;//g' "${TMP_CONFIG_FILE}" ${SED} -i 's/^\s*theme:\s\+".*"\s*;//g' "${TMP_CONFIG_FILE}"
} }
### ###