summaryrefslogtreecommitdiffstats
path: root/build/zip-examples.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-24 09:22:02 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-24 09:22:02 +0000
commit8b9e5144f7af3bb0578d80ed619dd0743d0d5f0f (patch)
treec651acc917541c3ad4fc91eb30df52c2f07095fd /build/zip-examples.js
parentAdding upstream version 5.3.1+dfsg. (diff)
downloadbootstrap-html-upstream.tar.xz
bootstrap-html-upstream.zip
Adding upstream version 5.3.3+dfsg.upstream/5.3.3+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--build/zip-examples.mjs (renamed from build/zip-examples.js)13
1 files changed, 8 insertions, 5 deletions
diff --git a/build/zip-examples.js b/build/zip-examples.mjs
index 7378c33..e5e39be 100644
--- a/build/zip-examples.js
+++ b/build/zip-examples.mjs
@@ -3,16 +3,19 @@
/*!
* Script to create the built examples zip archive;
* requires the `zip` command to be present!
- * Copyright 2020-2023 The Bootstrap Authors
+ * Copyright 2020-2024 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
-'use strict'
+import fs from 'node:fs/promises'
+import path from 'node:path'
+import { fileURLToPath } from 'node:url'
+import sh from 'shelljs'
-const path = require('node:path')
-const sh = require('shelljs')
+const __dirname = path.dirname(fileURLToPath(import.meta.url))
-const pkg = require('../package.json')
+const pkgJson = path.join(__dirname, '../package.json')
+const pkg = JSON.parse(await fs.readFile(pkgJson, 'utf8'))
const versionShort = pkg.config.version_short
const distFolder = `bootstrap-${pkg.version}-examples`