use crate::define_tool;
define_tool!(EKSCTL, {
command: "eksctl",
macos: { brew: "eksctl" },
linux: { uniform: "eksctl" },
windows: { winget: "weaveworks.eksctl" },
bsd: { pkg: "eksctl" },
default_hook: {
description: "Install eksctl shell completions for bash and zsh",
script: r#"
# Generate and install eksctl completions for bash
if [ -f "$HOME/.bashrc" ]; then
mkdir -p "$HOME/.local/share/bash-completion/completions"
eksctl completion bash > "$HOME/.local/share/bash-completion/completions/eksctl" 2>/dev/null || true
fi
# Generate and install eksctl completions for zsh
if [ -f "$HOME/.zshrc" ]; then
mkdir -p "$HOME/.zsh/completions"
eksctl completion zsh > "$HOME/.zsh/completions/_eksctl" 2>/dev/null || true
if ! grep -q 'fpath.*\.zsh/completions' "$HOME/.zshrc"; then
echo 'fpath=($HOME/.zsh/completions $fpath)' >> "$HOME/.zshrc"
fi
fi
"#
},
});
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn eksctl_registration_shape() {
assert_eq!(EKSCTL.command, "eksctl");
let mac = EKSCTL.macos.expect("must support macOS");
assert_eq!(mac.brew, Some("eksctl"));
let win = EKSCTL.windows.expect("must support Windows");
assert_eq!(win.winget, Some("weaveworks.eksctl"));
}
}