Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
grunt shell可以与用户交互吗?_Shell_Gruntjs_Bower_Grunt Shell - Fatal编程技术网

grunt shell可以与用户交互吗?

grunt shell可以与用户交互吗?,shell,gruntjs,bower,grunt-shell,Shell,Gruntjs,Bower,Grunt Shell,是否有一种方法允许用户与“grunt shell”(或其他任务,如“grunt exec”)调用的内部命令交互? 我有这样一个配置: grunt.initConfig({ shell: { bower_install: { command: 'bower install' } } }); 问题是,有时脚本需要与用户交互(例如,bower提示您选择软件包版本),但当我运行“grunt shell”任务时,在bower

是否有一种方法允许用户与“grunt shell”(或其他任务,如“grunt exec”)调用的内部命令交互? 我有这样一个配置:

  grunt.initConfig({
     shell: {
        bower_install: {
           command: 'bower install'
       }
     }
  });
问题是,有时脚本需要与用户交互(例如,bower提示您选择软件包版本),但当我运行“grunt shell”任务时,在bower通常要求用户选择的时间点之后,grunt任务失败

解决方法可能是使用bower依赖项,这样它就不会要求选择,而不是解决方案。我可以让grunt shell命令像通常从shell调用一样工作吗


感谢回复。

grunt shell 1.1.2可以通过标准文本与用户交互。以下grunt任务使用wget通过ftp下载目录,并提示我输入密码:

shell: {
    target: {
        command: 'wget --ftp-user=some-user --ask-password ftp://some-ftp/directory/*'
    }
}

有关bower的特定问题可能与在grunt shell中使用时,
read
似乎不响应输出的原因相同:提示仅在从终端发出命令时显示。看见这只是猜测。使用参数
-r-l0
递归下载所有子目录