aboutsummaryrefslogtreecommitdiff
path: root/scripts/updateVersion.js
diff options
context:
space:
mode:
authorcodecalm <codecalm@gmail.com>2022-04-16 14:50:51 +0200
committercodecalm <codecalm@gmail.com>2022-04-16 14:50:51 +0200
commitc291772a85d309a32896ce7d616157d93e631408 (patch)
tree19c9596f3e85df49c11f62cb099a3d7e3391926b /scripts/updateVersion.js
parentMerge branch 'master' of https://github.com/tabler/tabler-icons into v2.0 (diff)
downloadtabler-icons-c291772a85d309a32896ce7d616157d93e631408.tar.xz
icons-react build
Diffstat (limited to 'scripts/updateVersion.js')
-rw-r--r--scripts/updateVersion.js47
1 files changed, 0 insertions, 47 deletions
diff --git a/scripts/updateVersion.js b/scripts/updateVersion.js
deleted file mode 100644
index 218ffa9a..00000000
--- a/scripts/updateVersion.js
+++ /dev/null
@@ -1,47 +0,0 @@
-import p from '../package.json'
-import cp from 'child_process'
-import fs from 'fs'
-import { basename } from 'path'
-
-const setVersionToIcons = (version, files) => {
- for (const i in files) {
- const file = files[i]
-
- if (fs.existsSync(`src/_icons/${file}.svg`)) {
- let svgFile = fs.readFileSync(`src/_icons/${file}.svg`).toString()
-
- if (!svgFile.match(/version: ([0-9.]+)/i)) {
- svgFile = svgFile.replace(/---\n<svg>/i, function(m) {
- return `version: "${version}"\n${m}`
- })
-
- console.log(`Set version to ${version} in "${basename(file)}"`);
- fs.writeFileSync(`src/_icons/${file}.svg`, svgFile)
- } else {
- console.log(`File ${file} already has version`)
- }
- } else {
- console.log(`File ${file} doesn't exists`)
- }
- }
-}
-
-const updateIconsVersion = (version) => {
-
- if (version) {
- cp.exec(`grep -RiL "version: " ./src/_icons/*.svg`, function(err, ret) {
-
- let newIcons = []
-
- ret.replace(/src\/_icons\/([a-z0-9-]+)\.svg/g, function(m, fileName) {
- newIcons.push(fileName)
- })
-
- if (newIcons.length) {
- setVersionToIcons(version.replace(/\.0$/, ''), newIcons)
- }
- })
- }
-}
-
-updateIconsVersion(p.version)