operations/remote-bin-scripts

下载远程脚本以添加到项目的bin目录。

2.x-dev 2024-02-12 16:49 UTC

This package is auto-updated.

Last update: 2024-09-11 16:19:39 UTC


README

将文件下载到bin目录。

此插件允许您在composer install时指定要下载的URL作为脚本。

例如,您可以下载一个二进制文件或phar文件到您的vendor/bin目录。

优点

  1. 将PHP工具作为phar文件添加,以减轻对composer依赖的同步需求。
  2. 添加其他语言编写的脚本和工具。
  3. composer install集成。

用法

  1. 安装插件。

    $ composer require operations/remote-bin-scripts
    
  2. 添加到composer.json

    {
      "extra": {
        "remote-scripts": {
          "vendor/bin/hello-world": "https://raw.githubusercontent.com/operations-platform/composer-remote-bin-scripts/2.x/hello-world.sh"
        }
      }
    }
  3. 运行composer install

    $ composer install
    
  4. 从composer bin路径运行您的脚本

    ./vendor/bin/hello-world

    或者,如果您设置了PATH,只需使用命令。

    PATH=$PATH:./vendor/bin
    hello-world

关于