This commit is contained in:
2026-03-29 10:26:38 -05:00
parent 05d4f6e78b
commit b1c99893a6
1628 changed files with 67782 additions and 60143 deletions

View File

@@ -1,23 +1,23 @@
#!/usr/bin/env node
/* eslint-disable no-console */
require('dotenv').config();
const { closeDatabase, openDatabase } = require('../lib/sqlite');
const { ensurePlantSchema, getPlantDiagnostics } = require('../lib/plants');
const main = async () => {
const db = await openDatabase();
try {
await ensurePlantSchema(db);
const diagnostics = await getPlantDiagnostics(db);
console.log(JSON.stringify(diagnostics, null, 2));
} finally {
await closeDatabase(db);
}
};
main().catch((error) => {
console.error('Failed to read plant diagnostics.');
console.error(error instanceof Error ? error.stack || error.message : String(error));
process.exit(1);
});
#!/usr/bin/env node
/* eslint-disable no-console */
require('dotenv').config();
const { closeDatabase, openDatabase } = require('../lib/sqlite');
const { ensurePlantSchema, getPlantDiagnostics } = require('../lib/plants');
const main = async () => {
const db = await openDatabase();
try {
await ensurePlantSchema(db);
const diagnostics = await getPlantDiagnostics(db);
console.log(JSON.stringify(diagnostics, null, 2));
} finally {
await closeDatabase(db);
}
};
main().catch((error) => {
console.error('Failed to read plant diagnostics.');
console.error(error instanceof Error ? error.stack || error.message : String(error));
process.exit(1);
});