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:
parent
858d6c030c
commit
0b72ff2a74
2 changed files with 4 additions and 3 deletions
|
@ -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
|
||||||
|
|
|
@ -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}"
|
||||||
}
|
}
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
Loading…
Reference in a new issue