Skip to content

Commit

Permalink
Add chalk package and print versionedDir, newOrUpdatedSongs, and toBe…
Browse files Browse the repository at this point in the history
…RemovedFileNames in green and red colors.
  • Loading branch information
ioanlucut committed Sep 25, 2023
1 parent e14d317 commit da478b0
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/gDriveConverterRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import fs from 'fs';
import fsExtra from 'fs-extra';
import assert from 'node:assert';
import { isEmpty, isEqual } from 'lodash';
import chalk from 'chalk';
import { Config } from './proPresenter7SongConverter';
import { parseDateFromVersionedDir } from './core';
import {
Expand Down Expand Up @@ -145,7 +146,7 @@ export const convertSongsToPP7FormatRemotely = async ({

if (isEmpty(newOrUpdatedSongs)) {
console.log(
`[Remote]: Skip incremental local deployments as no changes have been found between the last two versions.`,
'[Remote]: Skip incremental local deployments as no changes have been found between the last two versions.',
);
return;
}
Expand All @@ -156,16 +157,23 @@ export const convertSongsToPP7FormatRemotely = async ({
.includes(id),
);

await uploadSongsAndManifestToGDrive(
const convertedAndWrittenToLocalOutDirSongs =
getConvertedAndWrittenToLocalOutDirSongs(
partialDeployableSongs,
deploymentVersionedDir,
config,
),
);

await uploadSongsAndManifestToGDrive(
convertedAndWrittenToLocalOutDirSongs,
versionedDir,
localManifestFilePath,
);

console.log(chalk.green(JSON.stringify(versionedDir)));
console.log(chalk.green(JSON.stringify(newOrUpdatedSongs)));
console.log(chalk.red(JSON.stringify(toBeRemovedFileNames)));

if (!isEmpty(toBeRemovedFileNames)) {
console.log(
`[Remote]: The following songs have been removed: ${toBeRemovedFileNames} manually.`,
Expand Down

0 comments on commit da478b0

Please sign in to comment.