diff options
Diffstat (limited to 'src/upd8.js')
-rwxr-xr-x | src/upd8.js | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/src/upd8.js b/src/upd8.js index 2b4fb5f6..9fff67cc 100755 --- a/src/upd8.js +++ b/src/upd8.js @@ -41,6 +41,8 @@ import genThumbs, { defaultMagickThreads, isThumb, } from './gen-thumbs.js'; + +import bootRepl from './repl.js'; import {listingSpec, listingTargetSpec} from './listing-spec.js'; import urlSpec from './url-spec.js'; @@ -126,7 +128,6 @@ async function main() { if (empty(selectedBuildModeFlags)) { selectedBuildModeFlag = 'static-build'; usingDefaultBuildMode = true; - logInfo`No build mode specified, using default: ${selectedBuildModeFlag}`; } else if (selectedBuildModeFlags.length > 1) { logError`Building multiple modes (${selectedBuildModeFlags.join(', ')}) at once not supported.`; logError`Please specify a maximum of one build mode.`; @@ -134,7 +135,6 @@ async function main() { } else { selectedBuildModeFlag = selectedBuildModeFlags[0]; usingDefaultBuildMode = false; - logInfo`Using specified build mode: ${selectedBuildModeFlag}`; } const selectedBuildMode = buildModes[selectedBuildModeFlag]; @@ -184,6 +184,16 @@ async function main() { type: 'value', }, + 'repl': { + help: `Boot into the HSMusic REPL for command-line interactive access to data objects`, + type: 'flag', + }, + + 'no-repl-history': { + help: `Disable locally logging commands entered into the REPL in your home directory`, + type: 'flag', + }, + // Thum8nail gener8tion is *usually* something you want, 8ut it can 8e // kinda a pain to run every time, since it does necessit8te reading // every media file at run time. Pass this to skip it. @@ -367,6 +377,9 @@ async function main() { const clearThumbsFlag = cliOptions['clear-thumbs'] ?? false; const noBuild = cliOptions['no-build'] ?? false; + const replFlag = cliOptions['repl'] ?? false; + const disableReplHistory = cliOptions['no-repl-history'] ?? false; + const showAggregateTraces = cliOptions['show-traces'] ?? false; const precacheData = cliOptions['precache-data'] ?? false; @@ -394,6 +407,16 @@ async function main() { } } + if (replFlag) { + return bootRepl({ + dataPath, + mediaPath, + + disableHistory: disableReplHistory, + showTraces: showAggregateTraces, + }); + } + const niceShowAggregate = (error, ...opts) => { showAggregate(error, { showTraces: showAggregateTraces, @@ -431,6 +454,12 @@ async function main() { if (thumbsOnly) return; } + if (usingDefaultBuildMode) { + logInfo`No build mode specified, using default: ${selectedBuildModeFlag}`; + } else { + logInfo`Using specified build mode: ${selectedBuildModeFlag}`; + } + if (showInvalidPropertyAccesses) { CacheableObject.DEBUG_SLOW_TRACK_INVALID_PROPERTIES = true; } |