Skip to content

Commit

Permalink
Merge pull request #1021 from TriliumNext/chore_move-generate-documents
Browse files Browse the repository at this point in the history
chore: move generate_documents  to bin folder
  • Loading branch information
eliandoran authored Jan 22, 2025
2 parents 4203a11 + 1d03818 commit 0b0fcc0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions src/tools/generate_document.ts → bin/generate_document.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/**
* Usage: node src/tools/generate_document.js 1000
* Usage: tsx ./generate_document.ts 1000
* will create 1000 new notes and some clones into the current document.db
*/

import sqlInit from "../services/sql_init.js";
import noteService from "../services/notes.js";
import attributeService from "../services/attributes.js";
import cls from "../services/cls.js";
import cloningService from "../services/cloning.js";
import sqlInit from "../src/services/sql_init.js";
import noteService from "../src/services/notes.js";
import attributeService from "../src/services/attributes.js";
import cls from "../src/services/cls.js";
import cloningService from "../src/services/cloning.js";
import loremIpsum from "lorem-ipsum";
import "../becca/entity_constructor.js";
import "../src/becca/entity_constructor.js";

const noteCount = parseInt(process.argv[2]);

Expand Down Expand Up @@ -90,4 +90,6 @@ async function start() {
process.exit(0);
}

sqlInit.dbReady.then(cls.wrap(start));
// @TriliumNextTODO sqlInit.dbReady never seems to resolve so program hangs
// see https://github.com/TriliumNext/Notes/issues/1020
sqlInit.dbReady.then(cls.wrap(start)).catch((err) => console.error(err));
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"integration-edit-db": "cross-env TRILIUM_INTEGRATION_TEST=edit TRILIUM_PORT=8081 TRILIUM_ENV=dev TRILIUM_DATA_DIR=./integration-tests/db nodemon src/main.ts",
"integration-mem-db": "cross-env TRILIUM_INTEGRATION_TEST=memory TRILIUM_PORT=8082 TRILIUM_DATA_DIR=./integration-tests/db nodemon src/main.ts",
"integration-mem-db-dev": "cross-env TRILIUM_INTEGRATION_TEST=memory TRILIUM_PORT=8082 TRILIUM_ENV=dev TRILIUM_DATA_DIR=./integration-tests/db nodemon src/main.ts",
"generate-document": "cross-env nodemon src/tools/generate_document.ts 1000",
"generate-document": "cross-env nodemon ./bin/generate_document.ts 1000",
"ci-update-nightly-version": "tsx ./bin/update-nightly-version.ts",
"prettier-check": "prettier . --check",
"prettier-fix": "prettier . --write"
Expand Down

0 comments on commit 0b0fcc0

Please sign in to comment.