Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

Commit eed4d9a

Browse files
authored
Cleanup fmt command (#53)
1 parent bf9c54d commit eed4d9a

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

Commands/Fmt.tmCommand

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,13 @@
1010
# shellcheck source=/dev/null
1111
. "${TM_SUPPORT_PATH}/lib/bash_init.sh"
1212
13-
set -e
13+
set -e
1414
1515
PATH=/opt/local/bin:/usr/local/bin:/usr/local/zig/bin:$PATH
1616
1717
require_cmd "${TM_ZIG:-zig}"
1818
19-
tmpfile=$(mktemp "${TMPDIR:-/tmp/}zig-fmt.XXXXXX")
20-
cat - > "$tmpfile"
21-
22-
if ! error=$("${TM_ZIG:-zig}" fmt "$tmpfile" 2>&1);then
23-
exit_show_tool_tip "${error//$tmpfile/$(basename "$TM_FILEPATH")}"
24-
fi
25-
26-
cat "$tmpfile"
27-
rm "$tmpfile"
19+
(eval "${TM_ZIG:-zig} fmt --stdin") || exit_show_tool_tip
2820
</string>
2921
<key>input</key>
3022
<string>document</string>

0 commit comments

Comments
 (0)