Skip to content

Commit

Permalink
add --root-folder-path and pass it through to push(), watch(), …
Browse files Browse the repository at this point in the history
…and `processScript()`
  • Loading branch information
samualtnorman committed Nov 25, 2024
1 parent 6dd031a commit 2ed0c4f
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/bin/hsm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ Warning: ${formatOption(noMinifyOption.name)} is deprecated and will be removed
if (noQuineCheatsOptions)
assertOptionIsBoolean(noQuineCheatsOptions)

const rootFolderPathOption = popOption(`root-folder-path`)
const rootFolderPath = rootFolderPathOption && resolvePath(String(rootFolderPathOption.value))

if (commands[0] == `golf` || commands[0] == `minify`) {
const watchOption = popOption(`watch`)
const target = commands[1]
Expand Down Expand Up @@ -208,7 +211,8 @@ Warning: ${formatOption(noMinifyOption.name)} is deprecated and will be removed
scriptName,
filePath: target,
mangleNames: mangleNamesOption?.value,
forceQuineCheats: forceQuineCheatsOption?.value ?? !noQuineCheatsOptions?.value
forceQuineCheats: forceQuineCheatsOption?.value ?? !noQuineCheatsOptions?.value,
rootFolderPath
})

const timeTook = performance.now() - timeStart
Expand Down Expand Up @@ -303,7 +307,8 @@ Warning: ${formatOption(noMinifyOption.name)} is deprecated and will be removed
onPush: info => logInfo(info, hackmudPath),
minify: noMinifyOption && !noMinifyOption.value,
mangleNames: mangleNamesOption?.value,
forceQuineCheats: forceQuineCheatsOption?.value ?? !noQuineCheatsOptions?.value
forceQuineCheats: forceQuineCheatsOption?.value ?? !noQuineCheatsOptions?.value,
rootFolderPath
})

if (infos instanceof Error) {
Expand Down Expand Up @@ -346,7 +351,8 @@ Warning: ${formatOption(dtsPathOption.name)} is deprecated and will be removed i
minify: noMinifyOption && !noMinifyOption.value,
mangleNames: mangleNamesOption?.value,
onReady: () => log(`Watching`),
forceQuineCheats: forceQuineCheatsOption?.value ?? !noQuineCheatsOptions?.value
forceQuineCheats: forceQuineCheatsOption?.value ?? !noQuineCheatsOptions?.value,
rootFolderPath
})

autoExit = false
Expand Down Expand Up @@ -494,6 +500,8 @@ ${colourN(`--dts-path`)}=${colourB(`<path>`)}
Path to generate a type declaration (.d.ts) file for the scripts
${colourN(`--watch`)}
Watch for changes
${colourN(`--root-folder-path`)}
The folder that root will be aliased to in import statements
${colourA(`Examples:`)}
${colourC(`hsm`)} ${colourL(commands[0])} ${colourV(`src`)}
Expand Down Expand Up @@ -539,7 +547,9 @@ ${colourN(`--mangle-names`)}
${colourN(`--force-quine-cheats`)}, ${colourN(`--no-quine-cheats`)}
${forceQuineCheatsOptionDescription}
${colourN(`--watch`)}
Watch for changes`
Watch for changes
${colourN(`--root-folder-path`)}
The folder that root will be aliased to in import statements`
))
} break

Expand Down

0 comments on commit 2ed0c4f

Please sign in to comment.