Skip to content

Commit

Permalink
Fix: don't put zipped multi-ROM games in a subdirectory (#1154)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmercm committed Jun 11, 2024
1 parent 860a9d2 commit c08e57a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/types/outputFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import ROM from './dats/rom.js';
import ArchiveEntry from './files/archives/archiveEntry.js';
import ArchiveFile from './files/archives/archiveFile.js';
import File from './files/file.js';
import FileFactory from './files/fileFactory.js';
import GameConsole from './gameConsole.js';
import Options, { GameSubdirMode } from './options.js';

Expand Down Expand Up @@ -450,7 +451,7 @@ export default class OutputFactory {
rom: ROM,
inputFile: File,
): string {
const { dir, name } = path.parse(this.getOutputFileBasename(
const { dir, name, ext } = path.parse(this.getOutputFileBasename(
options,
game,
rom,
Expand All @@ -464,7 +465,8 @@ export default class OutputFactory {

if ((options.getDirGameSubdir() === GameSubdirMode.MULTIPLE
&& game.getRoms().length > 1
&& !(inputFile instanceof ArchiveFile))
// Output file is an archive
&& !(FileFactory.isExtensionArchive(ext) || inputFile instanceof ArchiveFile))
|| options.getDirGameSubdir() === GameSubdirMode.ALWAYS
) {
output = path.join(game.getName(), output);
Expand Down

0 comments on commit c08e57a

Please sign in to comment.