Skip to content

Commit

Permalink
[fix] #178 Make sure output directory exists before running the conve…
Browse files Browse the repository at this point in the history
…rsion (#185)

Co-authored-by: Johnny Hausman <johnny@hausmanfamily.com>
  • Loading branch information
Hiro-Nakamura and Johnny Hausman authored Aug 3, 2021
1 parent 534a49e commit 62a58eb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions public/cli/lib/commands/convert.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { EventEmitter } from 'events';
import fs from 'fs';
import path from 'path';
import { AnimationSettings } from '../../../models/animationSettings.model';
import { ProgressState } from '../../../models/progressState.model';
Expand All @@ -16,8 +17,12 @@ export async function convert(
animationSettings: AnimationSettings,
onProgress: (progress: ProgressState) => void
): Promise<string> {

// Fix #178: make sure output directory exists
fs.mkdirSync(animationSettings.output.directory, {recursive: true});
const outputFilePath = path.join(animationSettings.output.directory, animationSettings.output.filename);
// const videoPathsToCombine: string[] = [];

const projectData: ProjectData = { outputLocation: animationSettings.output.directory };
let percent = 0;
const onRenderedProgress = ({ currentFrame, totalFrames }: RecordFrameEventData): void => {
Expand Down

0 comments on commit 62a58eb

Please sign in to comment.