Skip to content
This repository was archived by the owner on Jan 24, 2021. It is now read-only.

Commit e57336e

Browse files
committed
feat(cli): Restructure console.logging
1 parent 9aad483 commit e57336e

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ function deploy(userPath, bucketName, additionalParams) {
7373

7474
setAwsConfig(additionalParams);
7575

76-
console.log(chalk.blue(`Starting deployment of gatsby app to S3 bucket: ${bucketName}...`));
77-
7876
let uploadPath = userPath;
7977
if (!path.isAbsolute(userPath)) {
8078
uploadPath = path.resolve(userPath);

src/s3.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,14 @@ function uploadChangedFilesInDir(pathToUpload, bucketName, additionalParams) {
208208
message: 'No files found at specified path',
209209
});
210210
} else {
211+
if (!additionalParams || !additionalParams.reuploadAll) {
212+
console.log(chalk.blue('Determining objects files...'));
213+
}
211214
fileList.forEach((fileName) => {
212215
const bucketPath = path.relative(pathToUpload, fileName);
213216
if (additionalParams && additionalParams.reuploadAll) {
214217
// eslint-disable-next-line no-console
215-
console.log(chalk.yellow(`${fileListLength} objects found, re-uploading all...`));
218+
console.log(chalk.yellow(`${fileListLength} objects found, re-uploading all to S3 Bucket: ${bucketName}`));
216219
// eslint-disable-next-line max-len
217220
const fileListWithNoBase = fileList.map(currentFilePath => path.relative(pathToUpload, currentFilePath));
218221

@@ -235,7 +238,7 @@ function uploadChangedFilesInDir(pathToUpload, bucketName, additionalParams) {
235238
if (testedFiles === fileListLength) {
236239
if (changedFiles.length > 0) {
237240
// eslint-disable-next-line no-console
238-
console.log(chalk.yellow(`${fileListLength} objects found, ${changedFiles.length} objects require updates...`));
241+
console.log(chalk.yellow(`${fileListLength} objects found, uploading ${changedFiles.length} objects that require updates to S3 Bucket: ${bucketName}...`));
239242
uploadFiles(pathToUpload, changedFiles, bucketName, additionalParams)
240243
.then((msg) => {
241244
resolve({

0 commit comments

Comments
 (0)