2023-08-06 07:37:24 +03:00
|
|
|
import fs from 'node:fs/promises'
|
|
|
|
import path from 'node:path'
|
|
|
|
import { fileURLToPath } from 'node:url'
|
2018-11-28 13:03:28 +02:00
|
|
|
|
2023-08-06 07:37:24 +03:00
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
|
|
|
|
|
|
const pkgJson = path.join(__dirname, '../package.json')
|
|
|
|
const pkg = JSON.parse(await fs.readFile(pkgJson, 'utf8'))
|
2023-03-29 20:49:30 +03:00
|
|
|
|
2018-12-13 13:14:49 +02:00
|
|
|
const year = new Date().getFullYear()
|
2018-09-25 18:55:35 +03:00
|
|
|
|
2018-09-26 10:54:46 +03:00
|
|
|
function getBanner(pluginFilename) {
|
2018-09-25 18:55:35 +03:00
|
|
|
return `/*!
|
2018-09-26 10:54:46 +03:00
|
|
|
* Bootstrap${pluginFilename ? ` ${pluginFilename}` : ''} v${pkg.version} (${pkg.homepage})
|
2018-09-25 18:55:35 +03:00
|
|
|
* Copyright 2011-${year} ${pkg.author}
|
2020-06-16 21:41:47 +03:00
|
|
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
2018-09-25 18:55:35 +03:00
|
|
|
*/`
|
|
|
|
}
|
2018-09-26 10:54:46 +03:00
|
|
|
|
2023-08-06 07:37:24 +03:00
|
|
|
export default getBanner
|