autotag/app/lib/docker.js
2020-04-02 16:49:51 -05:00

16 lines
420 B
JavaScript

import Regex from './regex.js'
import path from 'path'
import fs from 'fs'
export default class Dockerfile extends Regex {
constructor (root = null) {
root = path.join(process.env.GITHUB_WORKSPACE, root)
core.debug(fs.readdirSync(root))
if (fs.statSync(root).isDirectory()) {
root = path.join(root, 'Dockerfile')
}
super(root, /LABEL[\s\t]+version=[\t\s+]?[\"\']?([0-9\.]+)[\"\']?/i)
}
}