mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-01 19:38:13 +03:00
* temporary dvctr * start of work * fix: timeouts in windows * fish? * feat: better, working stuff * refactor: rename database-seeds to seeds/ * better * fdsaf * feat: don't let our container get owned by root * fix: better user handling * feat: falling asleep at my desk i yield to you what i have done * feat: autoadminify * docs: denote trickshot * feat: open in browser on launch * better seeds workings... * fix: dont kill shell * docs: mention dev/debs * fix: whoops * fix: make seeds load within the century * feat: rest of the containerisation * feat: new alias * style: fix linter errors * fix: bad call * fix: better justfile
37 lines
780 B
JavaScript
37 lines
780 B
JavaScript
const { Command } = require("commander");
|
|
const { MutateCollection, ReadCollection, WriteCollection } = require("../util");
|
|
|
|
const program = new Command();
|
|
program.requiredOption("-t, --tableID <tableID>");
|
|
|
|
program.parse(process.argv);
|
|
const options = program.opts();
|
|
|
|
const tables = ReadCollection("tables.json");
|
|
|
|
let table;
|
|
|
|
for (const findTable of tables) {
|
|
if (findTable.tableID === options.tableID) {
|
|
table = findTable;
|
|
findTable.inactive = true;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (!table) {
|
|
throw new Error(`No such table ${options.tableID} exists.`);
|
|
}
|
|
|
|
MutateCollection("folders.json", (folders) => {
|
|
for (const folder of folders) {
|
|
if (table.folders.includes(folder.folderID)) {
|
|
folder.inactive = true;
|
|
}
|
|
}
|
|
|
|
return folders;
|
|
});
|
|
|
|
WriteCollection("tables.json", tables);
|