From da478b0a2276ef942551e1cae0b97758ad8fbc07 Mon Sep 17 00:00:00 2001 From: Ioan Lucut Date: Mon, 25 Sep 2023 22:19:56 +0300 Subject: [PATCH] Add chalk package and print versionedDir, newOrUpdatedSongs, and toBeRemovedFileNames in green and red colors. --- src/gDriveConverterRunner.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gDriveConverterRunner.ts b/src/gDriveConverterRunner.ts index 5259cbf..354fdf3 100644 --- a/src/gDriveConverterRunner.ts +++ b/src/gDriveConverterRunner.ts @@ -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 { @@ -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; } @@ -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.`,