如何在Windows

时间:2016-10-01 09:35:30

标签: php php-deployer

我想在Windows上安装Deployer。我遵循了以下步骤:

  • 在cmd中运行命令:D:\ composer require deployer / deployer:~3.0
  • 然后D:\ php vendor / bin / dep

当我在命令之上运行时,它会向我显示以下内容:

  

dir = $(d = $ {0%[/ \] *}; cd" $ d&#34 ;; cd" ../ deployer / deployer / bin"&& ; pwd)

# See if we are running in Cygwin by checking for cygpath program
if command -v 'cygpath' >/dev/null 2>&1; then
    # Cygwin paths start with /cygdrive/ which will break windows PHP,
    # so we need to translate the dir path to windows format. However
    # we could be using cygwin PHP which does not require this, so we
    # test if the path to PHP starts with /cygdrive/ rather than /usr/bin
    if [[ $(which php) == /cygdrive/* ]]; then
            dir=$(cygpath -m "$dir");
    fi
fi

dir=$(echo $dir | sed 's/ /\ /g')
"${dir}/dep" "$@"

此外,当我试图运行' dep'命令D:> dep self-update,它显示了这个错误:

  

' DEP'不被识别为内部或外部命令,可操作程序或批处理文件。

现在我该怎么做才能制作并运行部署脚本?请告诉我进一步的步骤。

3 个答案:

答案 0 :(得分:1)

全局安装Deployer

composer global require deployer/deployer

将Composer路径添加到Windows环境变量

%AppData%\Composer\vendor\bin 

打开新终端并运行dep命令

答案 1 :(得分:0)

在命令提示符下打开或导航到项目目录,然后使用vendor/bin/dep在Windows中使用dep

答案 2 :(得分:0)

给我打电话"vendor/bin/dep"

不要通过php运行命令