Tools: setup-unit: ctl edit: Append suffix to tmp file name
This allows the editor(1) to enable syntax highlighting. See suffixes(7). Cc: Liam Crilly <liam@nginx.com> Reviewed-by: Andrew Clayton <a.clayton@nginx.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
@@ -421,7 +421,12 @@ unit_ctl_edit()
|
||||
fi;
|
||||
local req_path="$1";
|
||||
|
||||
local tmp="$(mktemp)";
|
||||
echo "$req_path" \
|
||||
| sed 's%^/js_modules/.*%.js%' \
|
||||
| sed 's%^/config\>.*%.json%' \
|
||||
| sed 's%^/.*%.txt%' \
|
||||
| xargs mktemp --suffix \
|
||||
| read -r tmp;
|
||||
|
||||
unit_ctl_http ---s "$sock" -c --no-progress-meter GET "$req_path" \
|
||||
</dev/null >"$tmp";
|
||||
|
||||
Reference in New Issue
Block a user