diff --git a/.gitignore b/.gitignore index 041eeb4..a14b5cf 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules/ bun.lockb todo.txt proto.js -.env \ No newline at end of file +.env +VERSION \ No newline at end of file diff --git a/index.js b/index.js index 1cd957a..117adfb 100644 --- a/index.js +++ b/index.js @@ -22,7 +22,15 @@ const globalConfig = await db`select content from config where id = ${process.en process.exit(1) }) -const globalVersion = execSync(`git show --oneline -s`).toString().split(" ")[0] +function readVersion() { + try { + return fs.readFileSync('./VERSION', 'utf-8').split(" ")[0] + } catch { + return "00MIAU" + } +} + +const globalVersion = readVersion() // Returns ISO 8601 Date & 24hr time for UTC-7/PDT const startTime = new Date(new Date().getTime() - 25200000).toISOString().slice(0, 19).replace('T', ' ')