我正在尝试将ElasticSearch与Drupal集成,直到现在,除了命令drush sapi-i与输出崩溃之外,一切似乎都在正常工作:
> 'C:/xampp/htdocs/my-project/docroot/vendor/bin/drush' is not recognized as an internal or external command,
> operable program or batch file.
In ProcessBase.php line 172:
Output is empty.
search-api:index [--limit [LIMIT]] [--batch-size [BATCH-SIZE]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-d|--debug] [-y|--yes] [--no] [--remote-host REMOTE-HOST] [--remote-user REMOTE-USER] [-r|--root ROOT] [-l|--uri URI] [--simulate] [--pipe] [-D|--define DEFINE] [--druplicon] [--notify [NOTIFY]] [--xh-link XH-LINK] [--] []在使用drush sapi-i -d进行调试之后,对drush_backend_batch_process()的调用似乎是由于某种原因导致问题的。
发布于 2020-03-03 05:55:30
在检查了vendor/bin目录之后,我注意到drush脚本存在,但是由于某种原因,尽管我使用Git-bash执行了drush sapi-i命令,Drupal仍然试图访问文件的Windows类型(在我从Mac复制的源代码中不存在)。因此,创建下面的文件手动修复了问题。
drush.cmd文件:@echo off
setlocal DISABLEDELAYEDEXPANSION
php "%~dp0../drush/drush/drush" %*drush文件:#!/usr/bin/env sh
dir=$(cd "${0%[/\\]*}" > /dev/null; cd '../drush/drush' && pwd)
if [ -d /proc/cygdrive ]; then
case $(which php) in
$(readlink -n /proc/cygdrive)/*)
# We are in Cygwin using Windows php, so the path must be translated
dir=$(cygpath -m "$dir");
;;
esac
fi
"${dir}/drush" "$@"注意 drush脚本的行尾应该是LF (而不是drush.cmd需要的run ),所以在Git中,只需将cd放到脚本所在的位置并运行sed -i 's/\r$//' my-script-filename (如果编辑器只能使用D18保存)。
https://drupal.stackexchange.com/questions/291629
复制相似问题