0

我正在运行一个类似的脚本./ci.sh push[dev1],我得到了类似的响应zsh: no matches found: push[dev1]。我试图将别名放入 .zshrc 但不是很高兴。

我的 .zshrc 文件:

alias push='noglob push'
alias git='noglob git'
alias jake='noglob jake'
alias task='noglob task'
alias branch='noglob branch'
alias gp='git push'`

还有来自 jakefile.js 的任务:

desc('Push commits to integration machine for validation.');
   task('push', ['status'], (branch) => {
     if (!branch) {
    console.log(
      'This command will push your code to the integration machine. Pass your\n' +
      'branch name as a parameter (e.g., \'push[workstation_name]\').\n'
    );
    fail('No branch provided');
  }
  run([
    'git push origin ' + branch
  ], () => {
    console.log('\nOK. Current branch has been copied to integration machine.');
    complete();
  });
}, { async: true });

该文件ci.sh包含:

#!/bin/sh
. build/scripts/run_jake.sh -f build/scripts/ci.jakefile.js $*

谢谢你的帮助。

4

1 回答 1

0

只需转义括号

./ci.sh push\[dev1\]

于 2017-08-22T14:10:53.760 回答