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"), {
|
const lastTheme = await readFile(dir_project("last_theme.txt"), {
|
||||||
encoding: "utf-8"
|
encoding: "utf-8"
|
||||||
});
|
});
|
||||||
|
|
||||||
// let themeFileName = "test.txt"
|
|
||||||
|
|
||||||
let i = 50
|
|
||||||
let themeFileName = lastTheme
|
let themeFileName = lastTheme
|
||||||
while (themeFileName == lastTheme) {
|
if (process.argv[2]) {
|
||||||
themeFileName = randomItem(directory);
|
themeFileName = process.argv[2]
|
||||||
if (i < 0) break
|
} else {
|
||||||
i--
|
let i = 50
|
||||||
|
while (themeFileName == lastTheme) {
|
||||||
|
themeFileName = randomItem(directory);
|
||||||
|
if (i < 0) break
|
||||||
|
i--
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await writeFile(dir_project("last_theme.txt"), themeFileName, {
|
await writeFile(dir_project("last_theme.txt"), themeFileName, {
|
||||||
|
|
Loading…
Reference in a new issue