fix: support quotation marks for circleci

Fixes #1745
This commit is contained in:
Rhys Arkins 2018-03-29 19:25:31 +02:00
parent 9a28852eb9
commit ba614d4624
3 changed files with 4 additions and 4 deletions

View file

@ -9,7 +9,7 @@ function extractDependencies(content) {
const deps = [];
let lineNumber = 0;
for (const line of content.split('\n')) {
const match = line.match(/^\s*- image:\s*([^\s]+)\s*$/);
const match = line.match(/^\s*- image:\s*'?"?([^\s'"]+)'?"?\s*$/);
if (match) {
const currentFrom = match[1];
const {

View file

@ -7,7 +7,7 @@ function setNewValue(currentFileContent, upgrade) {
logger.debug(`circleci.setNewValue: ${upgrade.newFrom}`);
const lines = currentFileContent.split('\n');
const lineToChange = lines[upgrade.lineNumber];
const imageLine = new RegExp(/^(\s*- image:\s*)[^\s]+(\s*)$/);
const imageLine = new RegExp(/^(\s*- image:\s*'?"?)[^\s'"]+('?"?\s*)$/);
if (!lineToChange.match(imageLine)) {
logger.debug('No image line found');
return null;

View file

@ -55,7 +55,7 @@ jobs:
node-v4:
<<: *node-base
docker:
- image: node:4
- image: 'node:4'
node-v6:
<<: *node-base
docker:
@ -63,4 +63,4 @@ jobs:
node-v8:
<<: *node-base
docker:
- image: node:8.9.0
- image: "node:8.9.0"