2023-08-06 06:37:24 +02:00
|
|
|
import fs from 'node:fs/promises'
|
|
|
|
import path from 'node:path'
|
|
|
|
import { fileURLToPath } from 'node:url'
|
2018-11-28 12:03:28 +01:00
|
|
|
|
2023-08-06 06:37:24 +02: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 19:49:30 +02:00
|
|
|
|
2018-12-13 12:14:49 +01:00
|
|
|
const year = new Date().getFullYear()
|
2018-09-25 17:55:35 +02:00
|
|
|
|
2018-09-26 09:54:46 +02:00
|
|
|
function getBanner(pluginFilename) {
|
2018-09-25 17:55:35 +02:00
|
|
|
return `/*!
|
2018-09-26 09:54:46 +02:00
|
|
|
* Bootstrap${pluginFilename ? ` ${pluginFilename}` : ''} v${pkg.version} (${pkg.homepage})
|
2018-09-25 17:55:35 +02:00
|
|
|
* Copyright 2011-${year} ${pkg.author}
|
2020-06-16 20:41:47 +02:00
|
|
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
2018-09-25 17:55:35 +02:00
|
|
|
*/`
|
|
|
|
}
|
2018-09-26 09:54:46 +02:00
|
|
|
|
2023-08-06 06:37:24 +02:00
|
|
|
export default getBanner
|