25 个发布版 (10 个稳定版)

1.3.3 2024 年 8 月 15 日
0.9.1 2024 年 8 月 3 日
0.5.0 2024 年 7 月 31 日

#20命令行工具

Download history 74/week @ 2024-07-22 1096/week @ 2024-07-29 735/week @ 2024-08-05 253/week @ 2024-08-12

每月 2,158 次下载

GPL-3.0+

53KB
1K SLoC

binup

binup 尝试成为您从 GitHub 发布版手动安装的最后一个工具。它专注于单个二进制应用程序,并允许您在指定了如何从发布文件中查找每个应用程序的规则后自动安装和升级它们。

以下是它的工作方式。您创建 ~/.config/binup/config.yaml,内容如下

tools:
  binup:
    project: KonishchevDmitry/binup

... 并运行 binup install 命令来安装指定的应用程序或 binup upgrade 来升级已安装的应用程序。

该工具完全无状态:它不保存有关已安装二进制文件的信息。相反,它始终检查应用程序的实际状态:如果二进制文件缺失,则安装它。当二进制文件已安装时,它将以 --version 参数运行它并尝试解析其实际版本以与最新版本进行比较。如果无法确定版本(工具可能没有 --version 标志),binup 依赖于二进制文件的修改时间,始终将其设置为下载的发布存档的更新时间。

可用的配置选项

以下是一个包含所有可用配置选项的示例配置

# Path where to install the binaries (the default is ~/.local/bin)
path: /usr/local/bin

tools:
  # Binary name
  prometheus:
    # GitHub project name
    project: prometheus/prometheus

    # Changelog URL (will be printed on app upgrade)
    changelog: https://github.com/prometheus/prometheus/blob/main/CHANGELOG.md

    # Release archive pattern:
    # * By default shell-like glob matching is used (https://docs.rs/globset/latest/globset/#syntax)
    # * Pattern started with '~' is treated as regular expression (https://docs.rs/regex/latest/regex/#syntax)
    #
    # If it's not specified, the archive will be chosen automatically according to target platform.
    release_matcher: prometheus-*.linux-amd64.tar.gz

    # Binary path to look for inside the release archive. If it's not specified, the tool will try to find it automatically.
    binary_matcher: "*/prometheus"

    # Post-install script
    post: systemctl restart prometheus

# If you have a lot of tools, you may hit GitHub API rate limits for anonymous requests at some moment.
# So it's recommended to obtain GitHub token (https://github.com/settings/tokens) and specify it here.
# No permissions are required for the token – it's needed just to make API requests non-anonymous.
github:
  token: $token

依赖项

~24–43MB
~749K SLoC