aboutsummaryrefslogtreecommitdiff
path: root/scripts/updateBackgrounds.js
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-03-19 15:42:03 -0500
committermat <github@matdoes.dev>2022-03-19 15:42:03 -0500
commitadc2cd0d0f006776ccb982a19a98934cd8855132 (patch)
tree8f371a5107bb1990980319f03593a7ab4368f081 /scripts/updateBackgrounds.js
parent924e43c2ad9151eaaa2685cb6dc5ced5dccf1c40 (diff)
downloadskyblock-stats-adc2cd0d0f006776ccb982a19a98934cd8855132.tar.gz
skyblock-stats-adc2cd0d0f006776ccb982a19a98934cd8855132.tar.bz2
skyblock-stats-adc2cd0d0f006776ccb982a19a98934cd8855132.zip
Add random backgrounds for players based on UUID
Diffstat (limited to 'scripts/updateBackgrounds.js')
-rw-r--r--scripts/updateBackgrounds.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/updateBackgrounds.js b/scripts/updateBackgrounds.js
index 425e2fe..0c3e214 100644
--- a/scripts/updateBackgrounds.js
+++ b/scripts/updateBackgrounds.js
@@ -6,6 +6,8 @@ const imagePool = new ImagePool(cpus().length)
// read the file names in the backgrounds folder
const backgrounds = await fs.readdir('static/backgrounds')
+// sort by natural order
+backgrounds.sort((a, b) => a.localeCompare(b, 'en', { numeric: true, ignorePunctuation: true }))
await fs.writeFile(
'src/_backgrounds.json',