Can't access shell_alias commands inside of TOML tasks
#8461
Unanswered
john-flanagan
asked this question in
Troubleshooting and bug reports
Replies: 1 comment
-
|
The same issue applies to other tools that require specific configuration options. For example, in my shell aliases: [shell_alias]
cog = "cog --config {{ config_root }}/.config/cocogitto/config.toml"
typos = "typos --config {{ config_root }}/.config/typos/config.toml"
yamlfmt = "yamlfmt -conf {{ config_root }}/.config/yamlfmt/config.yml"If I want to run cog, typos, or yamlfmt within a hk config file, I have to override the default built-in commands to inject the necessary configuration flags: ["yamlfmt"] = (Builtins.yamlfmt) {
check_diff = "yamlfmt -conf .config/yamlfmt/config.yml -lint {{ files }}"
fix = "yamlfmt -conf .config/yamlfmt/config.yml {{ files }}"
}
["typos"] = (Builtins.typos) {
check_diff =
"""
output=$(typos --config .config/typos/config.toml --force-exclude --diff {{ files }})
[ -z "$output" ] && exit 0
printf "%s" "$output"
exit 1
"""
fix = "typos --config .config/typos/config.toml --force-exclude --write-changes {{ files }}"
}I’ve already opened a feature request on the Cocogitto repository to support configuration files via environment variables. However, relying on environment variables feels impractical for every potential command we might use in the future. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I defined a
shell_aliasfor a tool we distribute within our repository, but I'm not able to use that alias within a TOML task'srunblock.TOML:
CLI:
Beta Was this translation helpful? Give feedback.
All reactions