Make the theme selectable
This commit is contained in:
parent
6567ce2387
commit
6993e55738
1 changed files with 10 additions and 8 deletions
18
index.js
18
index.js
|
@ -110,15 +110,17 @@ async function getTodaysTheme() {
|
|||
const lastTheme = await readFile(dir_project("last_theme.txt"), {
|
||||
encoding: "utf-8"
|
||||
});
|
||||
|
||||
// let themeFileName = "test.txt"
|
||||
|
||||
let i = 50
|
||||
|
||||
let themeFileName = lastTheme
|
||||
while (themeFileName == lastTheme) {
|
||||
themeFileName = randomItem(directory);
|
||||
if (i < 0) break
|
||||
i--
|
||||
if (process.argv[2]) {
|
||||
themeFileName = process.argv[2]
|
||||
} else {
|
||||
let i = 50
|
||||
while (themeFileName == lastTheme) {
|
||||
themeFileName = randomItem(directory);
|
||||
if (i < 0) break
|
||||
i--
|
||||
}
|
||||
}
|
||||
|
||||
await writeFile(dir_project("last_theme.txt"), themeFileName, {
|
||||
|
|
Loading…
Reference in a new issue