Skip to content

Commit

Permalink
avoid unnecessary code file
Browse files Browse the repository at this point in the history
  • Loading branch information
nighca committed Mar 29, 2024
1 parent 8054db4 commit bfb1a0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion spx-gui/src/models/sprite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ export class Sprite extends Disposble {
isDraggable: this.isDraggable,
costumes: costumeConfigs
}
files[`${this.name}.spx`] = fromText(`${this.name}.spx`, this.code)
if (this.code !== '') {
files[`${this.name}.spx`] = fromText(`${this.name}.spx`, this.code)
}
files[`${assetPath}/${spriteConfigFileName}`] = fromConfig(spriteConfigFileName, config)
return files
}
Expand Down
4 changes: 3 additions & 1 deletion spx-gui/src/models/stage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ export class Stage {
export(): [RawStageConfig, Files] {
const files: Files = {}
const backdropConfigs: RawBackdropConfig[] = []
files[stageCodeFilePath] = fromText(stageCodeFileName, this.code)
if (this.code !== '') {
files[stageCodeFilePath] = fromText(stageCodeFileName, this.code)
}
for (const backdrop of this.backdrops) {
const [backdropConfig, backdropFiles] = backdrop.export()
backdropConfigs.push(backdropConfig)
Expand Down

0 comments on commit bfb1a0b

Please sign in to comment.