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 f04d3fb commit 8c23752
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion flake.nix
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
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 8c23752

Please sign in to comment.