Skip to content

Commit

Permalink
style: run format script
Browse files Browse the repository at this point in the history
  • Loading branch information
envin3 committed Apr 4, 2024
1 parent d4a5f13 commit 72f40e1
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .changeset/lazy-yaks-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
4 changes: 2 additions & 2 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'header-max-length': [0, 'always', 150]
}
'header-max-length': [0, 'always', 150],
},
}
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"src": "favicon.ico",
"type": "image/png",
"sizes": "512x512 128x128"
}
}
],
"start_url": ".",
"display": "standalone",
Expand Down
2 changes: 1 addition & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"src": "favicon.ico",
"type": "image/png",
"sizes": "512x512 128x128"
}
}
],
"start_url": ".",
"display": "standalone",
Expand Down
29 changes: 15 additions & 14 deletions scripts/generate-buildno.cjs
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
const childProcess = require("child_process")
const fs = require("fs")
const os = require("os")
const childProcess = require('child_process')
const fs = require('fs')
const os = require('os')

const file = './.env'

function setEnvValue(key, value) {
if (!fs.existsSync(file))
fs.writeFileSync('.env', '')
const ENV_VARS = fs.readFileSync(file, "utf8").split(os.EOL);
const target = ENV_VARS.indexOf(ENV_VARS.find((line) => {
return line.match(new RegExp(key))
}));
if (!fs.existsSync(file)) fs.writeFileSync('.env', '')
const ENV_VARS = fs.readFileSync(file, 'utf8').split(os.EOL)
const target = ENV_VARS.indexOf(
ENV_VARS.find((line) => {
return line.match(new RegExp(key))
})
)
ENV_VARS.splice(target, 1, `${key}=${value}`)
fs.writeFileSync(file, ENV_VARS.join(os.EOL))
}

(() => {
childProcess.exec("git rev-parse --short HEAD", (err, stdout) => {
setEnvValue("VITE_REACT_APP_GIT_SHA", stdout)
});
})();
;(() => {
childProcess.exec('git rev-parse --short HEAD', (err, stdout) => {
setEnvValue('VITE_REACT_APP_GIT_SHA', stdout)
})
})()

0 comments on commit 72f40e1

Please sign in to comment.