diff --git a/gdf.js b/gdf.js index c87229c..409d219 100755 --- a/gdf.js +++ b/gdf.js @@ -447,15 +447,15 @@ export class GDF { if (this.#pj.engines?.node) { // determine minimal version from package.json - let { node } = this.#pj.engines - let minversion = node.match(/\d+(\.\d+(\.\d+)?)?/)?.[0].split('.') - if (node.includes('>') && !node.includes("=")) { + const { node } = this.#pj.engines + const minversion = node.match(/\d+(\.\d+(\.\d+)?)?/)?.[0].split('.') + if (node.includes('>') && !node.includes('=')) { minversion.push(parseInt(minversion.pop()) + 1) } // ensure version is at least the minimum version = version.split('.') - for (const i=0; i version[i]) { version = minversion break diff --git a/test/test.js b/test/test.js index c070f7a..559df36 100644 --- a/test/test.js +++ b/test/test.js @@ -30,7 +30,7 @@ for (const group of fs.readdirSync('test', { withFileTypes: true })) { await new GDF().run(workdir, options) let argmask = /^(ARG\s+\w+\s*=).*?(\s*\\?)$/gm - if (entry.name == 'version') argmask = /()xxx()/g + if (entry.name === 'version') argmask = /()xxx()/g const actualResults = fs.readFileSync(path.join(workdir, 'Dockerfile'), 'utf-8') .replaceAll(argmask, '$1xxx$2')