From bafe8692213d778190bdcf4bce783d986e57e4f7 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Mon, 20 Jan 2025 16:28:36 -0500 Subject: [PATCH] Remove output option --- index.js | 3 ++- src/settings.js | 3 +++ src/wizard.js | 6 ------ src/writer.js | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index cd286c6..f1a9298 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,7 @@ import path from 'path'; import process from 'process'; import * as parser from './src/parser.js'; +import * as settings from './src/settings.js'; import * as wizard from './src/wizard.js'; import * as writer from './src/writer.js'; @@ -18,7 +19,7 @@ import * as writer from './src/writer.js'; // happy goodbye console.log('\nAll done!'); - console.log('Look for your output files in: ' + path.resolve(config.output)); + console.log('Look for your output files in: ' + path.resolve(settings.output_directory)); })().catch(ex => { // sad goodbye console.log('\nSomething went wrong, execution halted early.'); diff --git a/src/settings.js b/src/settings.js index 58e67b3..28ef891 100644 --- a/src/settings.js +++ b/src/settings.js @@ -49,3 +49,6 @@ export const filter_post_types = [ 'wp_global_styles', 'wp_navigation' ]; + +// Output directory. +export const output_directory = 'output'; diff --git a/src/wizard.js b/src/wizard.js index e625a47..2436439 100644 --- a/src/wizard.js +++ b/src/wizard.js @@ -19,12 +19,6 @@ const options = [ description: 'Path to WordPress export file', default: 'export.xml' }, - { - name: 'output', - type: 'folder', - description: 'Path to output folder', - default: 'output' - }, { name: 'year-folders', type: 'boolean', diff --git a/src/writer.js b/src/writer.js index 7df7520..0b4ea54 100644 --- a/src/writer.js +++ b/src/writer.js @@ -180,7 +180,7 @@ function getPostPath(post, config) { } // start with base output dir and post type - const pathSegments = [config.output, post.meta.type]; + const pathSegments = [settings.output_directory, post.meta.type]; if (config.yearFolders) { pathSegments.push(dt.toFormat('yyyy'));