Skip to content

Commit

Permalink
appease elint
Browse files Browse the repository at this point in the history
  • Loading branch information
rubys committed Jun 20, 2024
1 parent 1a83425 commit 5180e24
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions gdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.length; i++) {
for (let i = 0; i < version.length; i++) {
if (minversion[i] > version[i]) {
version = minversion
break
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 5180e24

Please sign in to comment.