File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 55import type { IBlueprintBoneConfigJSON , IBlueprintVariantJSON } from '../blueprintFormat'
66import { type defaultValues } from '../blueprintSettings'
77import { EasingKey } from '../util/easing'
8+ import { resolvePath } from '../util/fileUtil'
89import { detectCircularReferences , scrubUndefined } from '../util/misc'
910import { Variant } from '../variants'
1011import type { INodeTransform , IRenderedAnimation , IRenderedFrame } from './animationRenderer'
@@ -212,7 +213,16 @@ export function exportJSON(options: {
212213 }
213214 console . log ( 'Scrubbed:' , scrubUndefined ( json ) )
214215
215- fs . writeFileSync ( aj . json_file , compileJSON ( json ) . toString ( ) )
216+ let exportPath : string
217+ try {
218+ exportPath = resolvePath ( aj . json_file )
219+ } catch ( e ) {
220+ console . log ( `Failed to resolve export path '${ aj . json_file } '` )
221+ console . error ( e )
222+ return
223+ }
224+
225+ fs . writeFileSync ( exportPath , compileJSON ( json ) . toString ( ) )
216226}
217227
218228function serailizeRenderedNode ( node : AnyRenderedNode ) : ExportedRenderedNode {
You can’t perform that action at this time.
0 commit comments