Linux cesa-www-main 6.1.0-49-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
Apache/2.4.68 (Debian)
Server IP : 10.218.0.2 & Your IP : 216.73.216.28
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
cesa.co.za /
vendor /
twbs /
bootstrap /
build /
Delete
Unzip
Name
Size
Permission
Date
Action
banner.mjs
620
B
-rw-r--r--
2024-02-14 08:50
build-plugins.mjs
2.83
KB
-rw-r--r--
2024-02-14 08:50
change-version.mjs
2.73
KB
-rw-r--r--
2024-02-14 08:50
generate-sri.mjs
1.7
KB
-rw-r--r--
2024-02-14 08:50
postcss.config.mjs
311
B
-rw-r--r--
2024-02-14 08:50
rollup.config.mjs
1.43
KB
-rw-r--r--
2024-02-14 08:50
vnu-jar.mjs
1.9
KB
-rw-r--r--
2024-02-14 08:50
zip-examples.mjs
2.77
KB
-rw-r--r--
2024-02-14 08:50
Save
Rename
#!/usr/bin/env node /*! * Script to update version number references in the project. * Copyright 2017-2023 The Bootstrap Authors * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ import { execFile } from 'node:child_process' import fs from 'node:fs/promises' import process from 'node:process' const VERBOSE = process.argv.includes('--verbose') const DRY_RUN = process.argv.includes('--dry') || process.argv.includes('--dry-run') // These are the files we only care about replacing the version const FILES = [ 'README.md', 'hugo.yml', 'js/src/base-component.js', 'package.js', 'scss/mixins/_banner.scss', 'site/data/docs-versions.yml' ] // Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37 function regExpQuote(string) { return string.replace(/[$()*+-.?[\\\]^{|}]/g, '\\$&') } function regExpQuoteReplacement(string) { return string.replace(/\$/g, '$$') } async function replaceRecursively(file, oldVersion, newVersion) { const originalString = await fs.readFile(file, 'utf8') const newString = originalString .replace( new RegExp(regExpQuote(oldVersion), 'g'), regExpQuoteReplacement(newVersion) ) // Also replace the version used by the rubygem, // which is using periods (`.`) instead of hyphens (`-`) .replace( new RegExp(regExpQuote(oldVersion.replace(/-/g, '.')), 'g'), regExpQuoteReplacement(newVersion.replace(/-/g, '.')) ) // No need to move any further if the strings are identical if (originalString === newString) { return } if (VERBOSE) { console.log(`Found ${oldVersion} in ${file}`) } if (DRY_RUN) { return } await fs.writeFile(file, newString, 'utf8') } function bumpNpmVersion(newVersion) { if (DRY_RUN) { return } execFile('npm', ['version', newVersion, '--no-git-tag'], { shell: true }, error => { if (error) { console.error(error) process.exit(1) } }) } function showUsage(args) { console.error('USAGE: change-version old_version new_version [--verbose] [--dry[-run]]') console.error('Got arguments:', args) process.exit(1) } async function main(args) { let [oldVersion, newVersion] = args if (!oldVersion || !newVersion) { showUsage(args) } // Strip any leading `v` from arguments because // otherwise we will end up with duplicate `v`s [oldVersion, newVersion] = [oldVersion, newVersion].map(arg => { return arg.startsWith('v') ? arg.slice(1) : arg }) if (oldVersion === newVersion) { showUsage(args) } bumpNpmVersion(newVersion) try { await Promise.all( FILES.map(file => replaceRecursively(file, oldVersion, newVersion)) ) } catch (error) { console.error(error) process.exit(1) } } main(process.argv.slice(2))