0
“意外的文件结尾”的声明
我想在我的测试打印echo "showing dev branch"
如果我的分支名称是development
做一个条件,但我收到此错误如果与circleCI
if [ "${CIRCLE_BRANCH}" == "development"]; then echo "showing dev branch" fi
bash: -c: line 2: syntax error: unexpected end of file
if [ "${CIRCLE_BRANCH}" == "development"]; then echo "showing dev branch" fi returned exit code 1
见我下面circle.yml:
general:
artifacts:
- "test_evidences"
branches:
only:
- development
machine:
node:
version: 6.10.3
dependencies:
pre:
- curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo dpkg -i google-chrome.deb
- sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome
- rm google-chrome.deb
- npm install
- npm install -g grunt grunt-cli
override:
- node_modules/.bin/webdriver-manager update
test:
pre:
- sleep 60
override:
- if [ "${CIRCLE_BRANCH}" == "development"]; then
echo "showing dev branch"
fi
- grunt apiTests
- node_modules/.bin/protractor conf.js
- sed -i -- 's,//,/,g' test_evidences/htmlReport.html
你以前']'需要的空间。另外,www.shellcheck.net对于很多这种类型的东西来说非常方便 –
并且在'fi'之前还有分号,如果它是作为单行运行的(不知道这是否真的发生,或者它只是一个人为因素日志) –