Skip to content

Commit

Permalink
editor: replace echo | cut by var substitution
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Deziel <[email protected]>
(cherry picked from commit d666ce1)
  • Loading branch information
simondeziel authored and tomponline committed Jul 11, 2024
1 parent e08b33b commit a4bd1c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion snapcraft/wrappers/editor
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fi
if [ -n "${EDIT_CMD}" ] && [ "${USERNS}" = 1 ]; then
exec 9< /tmp/
# Replace "/tmp/" prefix by exec'ed FD 9.
EDIT_PATH_HOST="/proc/self/fd/9/$(echo "${EDIT_PATH}" | cut -d/ -f3)"
EDIT_PATH_HOST="/proc/self/fd/9/${EDIT_PATH##*/}"
find_and_spawn "${EDIT_CMD}" "${EDIT_PATH_HOST}"
fi

Expand Down

0 comments on commit a4bd1c4

Please sign in to comment.