Skip to content

Commit

Permalink
CLI Changes Sub-PR: Update supplementary tools (#594)
Browse files Browse the repository at this point in the history
* Update TTY playground to use new interface

* Update pre-commit hook to use new interface
  • Loading branch information
Xophmeister committed Aug 14, 2023
1 parent 2588964 commit fb8fc03
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
topiary-inplace = pkgs.writeShellApplication {
name = "topiary-inplace";
text = ''
${code.topiary-cli}/bin/topiary --in-place --input-files "$@";
${code.topiary-cli}/bin/topiary fmt "$@";
'';
};
in
Expand Down
12 changes: 3 additions & 9 deletions playground.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,10 @@ format() {
local input="$2"
local skip_idempotence="${3-1}"

local -a topiary_args=(
--query "${query}"
--input-files "${input}"
)
local -a topiary_args=(--query "${query}")
(( skip_idempotence )) && topiary_args+=(--skip-idempotence)

if (( skip_idempotence )); then
topiary_args+=(--skip-idempotence)
fi

cargo run --quiet -- "${topiary_args[@]}"
cargo run --quiet -- fmt "${topiary_args[@]}" < "${input}"
}

idempotency() {
Expand Down

0 comments on commit fb8fc03

Please sign in to comment.