Fix hardcoded paths in Kitten

This commit is contained in:
Radon Rosborough 2021-02-20 11:00:39 -08:00
parent 85baab80b5
commit 9243a10a4d
1 changed files with 5 additions and 0 deletions

View File

@ -19,6 +19,11 @@ install:
cp common.ktn "${pkg}/opt/kitten/"
popd
pat="$(strings "${pkg}/usr/local/bin/kitten" | grep share | tr -d '\n' | xxd -p | tr -d '\n')"
repl="$(echo -n /opt/kitten | xxd -p | tr -d '\n')"
repl="$(printf "%-$(echo -n "${pat}" | wc -c)s" "${repl}" | sed 's/ /0/g')"
cat "${pkg}/usr/local/bin/kitten" | xxd -p | tr -d '\n' | sed "s/${pat}/${repl}/g" | xxd -p -r | sponge "${pkg}/usr/local/bin/kitten"
repl: |
kitten
input: |