autotag/src/lib/docker.js

16 lines
385 B
JavaScript
Raw Normal View History

import Regex from './regex.js'
2022-10-15 00:10:47 +07:00
import { join } from 'path'
import { statSync } from 'fs'
export default class Dockerfile extends Regex {
constructor (root = null) {
2022-10-15 00:10:47 +07:00
root = join(process.env.GITHUB_WORKSPACE, root)
2020-04-03 11:38:10 +07:00
2022-10-15 00:10:47 +07:00
if (statSync(root).isDirectory()) {
root = join(root, 'Dockerfile')
}
super(root, /LABEL[\s\t]+version=[\t\s+]?[\"\']?([0-9\.]+)[\"\']?/i)
}
}