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 5
5
import type { IBlueprintBoneConfigJSON , IBlueprintVariantJSON } from '../blueprintFormat'
6
6
import { type defaultValues } from '../blueprintSettings'
7
7
import { EasingKey } from '../util/easing'
8
+ import { resolvePath } from '../util/fileUtil'
8
9
import { detectCircularReferences , scrubUndefined } from '../util/misc'
9
10
import { Variant } from '../variants'
10
11
import type { INodeTransform , IRenderedAnimation , IRenderedFrame } from './animationRenderer'
@@ -212,7 +213,16 @@ export function exportJSON(options: {
212
213
}
213
214
console . log ( 'Scrubbed:' , scrubUndefined ( json ) )
214
215
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 ( ) )
216
226
}
217
227
218
228
function serailizeRenderedNode ( node : AnyRenderedNode ) : ExportedRenderedNode {
You can’t perform that action at this time.
0 commit comments