From 48b38c4d510eebf59391017100131edddcd5ba5d Mon Sep 17 00:00:00 2001 From: mohamed yahia Date: Wed, 6 Dec 2023 19:07:13 +0200 Subject: [PATCH] Remove the init command --- src/bin/index.js | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/bin/index.js b/src/bin/index.js index 5fb9c0a..20292e4 100755 --- a/src/bin/index.js +++ b/src/bin/index.js @@ -16,33 +16,10 @@ async function loadConfig(configFilePath) { } } -async function initConfigFile(configFilePath = "mddb.config.js") { - const normalizedPath = path.resolve(configFilePath); - const configFileContent = `export default {\n customFields: []\n};\n`; - - try { - await fs.writeFile(normalizedPath, configFileContent); - console.log(`Configuration file created at ${normalizedPath}`); - } catch (error) { - throw new Error(`Error creating configuration file at ${normalizedPath}: ${error.message}`); - } -} - // TODO get these from markdowndb.config.js or something const dbPath = "markdown.db"; const ignorePatterns = [/Excalidraw/, /\.obsidian/, /DS_Store/]; -let command, contentPath, configFilePath; - -if (process.argv[2] === 'init') { - [command, contentPath, configFilePath] = process.argv.slice(2); -} else { - [contentPath, configFilePath] = process.argv.slice(2); -} - -if (command === 'init') { - await initConfigFile(configFilePath); - process.exit(); -} +const [contentPath, configFilePath] = process.argv.slice(2); if (!contentPath) { throw new Error("Invalid/Missing path to markdown content folder");