Skip to content

Commit

Permalink
user/*: drop pointless inconsistent variables, format
Browse files Browse the repository at this point in the history
  • Loading branch information
q66 committed Oct 2, 2024
1 parent 7e0e7e3 commit 1c78be5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
12 changes: 3 additions & 9 deletions user/kind/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,14 @@
sha256 = "eb7bcb8005ff980d7d7ad088165a5a6236f484444aa397520cd98cb046e1d797"
# cross: uses host binary to generate completions
options = ["!cross"]
_supported_completions = ["bash", "zsh", "fish"]


def post_build(self):
for completion in _supported_completions:
for completion in ["bash", "fish", "zsh"]:
with open(f"{self.cwd}/kind.{completion}", "w") as o:
self.do(
"build/kind",
"completion",
completion,
stdout=o,
)
self.do("build/kind", "completion", completion, stdout=o)


def post_install(self):
for completion in _supported_completions:
for completion in ["bash", "fish", "zsh"]:
self.install_completion(f"kind.{completion}", completion)
5 changes: 2 additions & 3 deletions user/magic-wormhole.rs/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
url = "https://github.com/magic-wormhole/magic-wormhole.rs"
source = f"{url}/archive/refs/tags/{pkgver}.tar.gz"
sha256 = "c6e2acd3cccd982f449d26184d714d4cf813f51b8b75b3e36ecbb78565b3f4e8"
_supported_shells = ["bash", "fish", "zsh"]
# generates completions with host bin
options = ["!check", "!cross"]


def post_build(self):
for shell in _supported_shells:
for shell in ["bash", "fish", "zsh"]:
with open(f"{self.cwd}/wormhole-rs.{shell}", "w") as o:
self.do(
f"target/{self.profile().triplet}/release/wormhole-rs",
Expand All @@ -31,7 +30,7 @@ def install(self):
self.install_bin(
f"target/{self.profile().triplet}/release/wormhole-rs",
)
for shell in _supported_shells:
for shell in ["bash", "fish", "zsh"]:
self.install_completion(f"wormhole-rs.{shell}", shell, "wormhole-rs")
self.install_man("wormhole.1")
self.install_license("LICENSE")
5 changes: 2 additions & 3 deletions user/topgrade/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
url = "https://github.com/topgrade-rs/topgrade"
source = f"{url}/archive/refs/tags/v{pkgver}.tar.gz"
sha256 = "53c6521041a6ffddf1ccb13f404f131919a2ef48deb3974fc71dc3be08db6cd0"
_supported_shells = ["bash", "fish", "zsh"]
# generates completions with host binary
options = ["!cross"]


def post_build(self):
for shell in _supported_shells:
for shell in ["bash", "fish", "zsh"]:
with open(f"{self.cwd}/topgrade.{shell}", "w") as o:
self.do(
f"target/{self.profile().triplet}/release/topgrade",
Expand All @@ -34,7 +33,7 @@ def post_build(self):

def install(self):
self.install_bin(f"target/{self.profile().triplet}/release/topgrade")
for shell in _supported_shells:
for shell in ["bash", "fish", "zsh"]:
self.install_completion(f"topgrade.{shell}", shell)
self.install_man("topgrade.8")
self.install_file(
Expand Down

0 comments on commit 1c78be5

Please sign in to comment.