diff options
author | Alejandro Colomar <alx@kernel.org> | 2024-02-09 00:49:07 +0100 |
---|---|---|
committer | Alejandro Colomar <alx@kernel.org> | 2024-02-20 16:04:25 +0100 |
commit | 6aa5ef63ce52df598b73c496955f1c0fddd01fb4 (patch) | |
tree | 7a6ceae51b382fb8823ced70b761a1f4c8063eee /tools | |
parent | bc093ab3ee72ca9606fea821fe5c4af221737331 (diff) | |
download | unit-6aa5ef63ce52df598b73c496955f1c0fddd01fb4.tar.gz unit-6aa5ef63ce52df598b73c496955f1c0fddd01fb4.tar.bz2 |
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>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/setup-unit | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/setup-unit b/tools/setup-unit index 5fb7218e..a0dafe10 100755 --- a/tools/setup-unit +++ b/tools/setup-unit @@ -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"; |