Skip to content

🎥 Make videos programmatically with React

exists / new indicator

Jonny Burger1d61946c7215
diff --git a/packages/cli/src/progress-bar.ts b/packages/cli/src/progress-bar.ts
index d95f9c6ec1..a0c93a32b5 100644
--- a/packages/cli/src/progress-bar.ts
+++ b/packages/cli/src/progress-bar.ts
@@ -42,7 +42,7 @@ export const createOverwriteableCliOutput = (options: {
.map((l) => {
return `${RenderInternals.INDENT_TOKEN} ${l}`;
})
- .join('\n') + '\n'
+ .join('\n')
);
} else {
process.stdout.write(up + '\n');
@@ -73,7 +73,7 @@ export const createOverwriteableCliOutput = (options: {
);
}
- return process.stdout.write(diff.update(up));
+ return process.stdout.write(diff.update(up + (newline ? '\n' : '')));
},
};
};
diff --git a/packages/cli/src/render-flows/render.ts b/packages/cli/src/render-flows/render.ts
index bf9ac198fb..081c133bfd 100644
--- a/packages/cli/src/render-flows/render.ts
+++ b/packages/cli/src/render-flows/render.ts
@@ -21,7 +21,7 @@ import {
RenderInternals,
renderMedia,
} from '@remotion/renderer';
-import fs from 'node:fs';
+import fs, {existsSync} from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import {chalk} from '../chalk';
@@ -315,6 +315,7 @@ export const renderVideoFlow = async ({
relativeOutputLocation,
overwrite
);
+ const exists = existsSync(absoluteOutputFile);
const realFrameRange = RenderInternals.getRealFrameRange(
config.durationInFrames,
@@ -483,7 +484,10 @@ export const renderVideoFlow = async ({
});
updateRenderProgress(true);
- Log.infoAdvanced({indent, logLevel}, chalk.blue(`▶ ${absoluteOutputFile}`));
+ Log.infoAdvanced(
+ {indent, logLevel},
+ chalk.blue(`${exists ? '⌾' : '+'} ${absoluteOutputFile}`)
+ );
for (const line of RenderInternals.perf.getPerf()) {
Log.verboseAdvanced({indent, logLevel}, line);
diff --git a/packages/cli/src/render-flows/still.ts b/packages/cli/src/render-flows/still.ts
index 70114f144d..c2d775ca72 100644
--- a/packages/cli/src/render-flows/still.ts
+++ b/packages/cli/src/render-flows/still.ts
@@ -15,7 +15,7 @@ import {
RenderInternals,
renderStill,
} from '@remotion/renderer';
-import {mkdirSync} from 'node:fs';
+import {existsSync, mkdirSync} from 'node:fs';
import path from 'node:path';
import {chalk} from '../chalk';
import {registerCleanupJob} from '../cleanup-before-quit';
@@ -214,6 +214,7 @@ export const renderStillFlow = async ({
relativeOutputLocation,
overwrite
);
+ const exists = existsSync(absoluteOutputLocation);
mkdirSync(path.join(absoluteOutputLocation, '..'), {
recursive: true,
@@ -297,6 +298,6 @@ export const renderStillFlow = async ({
updateProgress(true);
Log.infoAdvanced(
{indent: indentOutput, logLevel},
- chalk.blue(`▶️ ${absoluteOutputLocation}`)
+ chalk.blue(`${exists ? '⌾' : '+'} ${absoluteOutputLocation}`)
);
};