Skip to content

Commit

Permalink
fix(app-builder): remove some extremely verbose logging
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Nov 20, 2024
1 parent d012654 commit 6a5cf1e
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 24 deletions.
12 changes: 0 additions & 12 deletions apps/app-builder/src/utils/fs/copyFile.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import path from 'node:path';
import fs from 'node:fs';
import chalk from 'chalk';
import {type OneOrMore} from '@myparcel/ts-utils';
import {resolvePath} from '../resolvePath';
import {logTargetPath} from '../debug/logTargetPath';
import {logSourcePath} from '../debug/logSourcePath';
import {isVeryVeryVerbose} from '../command/isVeryVeryVerbose';
import {isDryRun} from '../command/isDryRun';
import {type StringGenerator} from '../../types/common.types';
import {type PdkBuilderContext} from '../../types/command.types';
Expand All @@ -21,14 +17,6 @@ export const copyFile = async (

await createDirectories(context, path.dirname(resolvedTarget));

if (isVeryVeryVerbose(context)) {
context.debug(
chalk.yellowBright('Copying %s to %s'),
logSourcePath(resolvedSource, context),
logTargetPath(resolvedTarget, context),
);
}

if (isDryRun(context)) {
return;
}
Expand Down
2 changes: 0 additions & 2 deletions apps/app-builder/src/utils/fs/createDirectory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import fs from 'node:fs';
import chalk from 'chalk';
import {resolveString} from '../resolveString';
import {resolvePath} from '../resolvePath';
import {reportDirectoryExists} from '../debug/reportOnFile';
import {logTargetPath} from '../debug/logTargetPath';
import {isVeryVeryVerbose} from '../command/isVeryVeryVerbose';
import {isDryRun} from '../command/isDryRun';
Expand All @@ -15,7 +14,6 @@ export const createDirectory = async (context: PdkBuilderContext, item: StringGe
const resolvedPath = resolveString(item, context);

if (await exists(resolvedPath)) {
reportDirectoryExists(resolvedPath, context);
return;
}

Expand Down
2 changes: 0 additions & 2 deletions apps/app-builder/src/utils/fs/deleteDirectory.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import fs from 'node:fs';
import chalk from 'chalk';
import {resolvePath} from '../resolvePath';
import {reportDirectoryDoesNotExist} from '../debug/reportOnFile';
import {logSourcePath} from '../debug/logSourcePath';
import {shouldModifyFiles} from '../command/shouldModifyFiles';
import {isVeryVeryVerbose} from '../command/isVeryVeryVerbose';
Expand All @@ -12,7 +11,6 @@ export const deleteDirectory = async (context: PdkBuilderContext, directoryPath:
const resolvedPath = resolvePath(directoryPath, context);

if (!(await exists(resolvedPath))) {
reportDirectoryDoesNotExist(resolvedPath, context);
return;
}

Expand Down
3 changes: 0 additions & 3 deletions apps/app-builder/src/utils/fs/deleteFile.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import fs from 'node:fs';
import chalk from 'chalk';
import {reportFileDoesNotExist} from '../debug/reportOnFile';
import {logSourcePath} from '../debug/logSourcePath';
import {isVeryVeryVerbose} from '../command/isVeryVeryVerbose';
import {isDryRun} from '../command/isDryRun';
Expand All @@ -9,8 +8,6 @@ import {exists} from './exists';

export const deleteFile = async (context: PdkBuilderContext, filePath: string): Promise<void> => {
if (!(await exists(filePath))) {
reportFileDoesNotExist(filePath, context);

return;
}

Expand Down
3 changes: 0 additions & 3 deletions apps/app-builder/src/utils/fs/renameFile.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import fs from 'node:fs';
import {type OneOrMore} from '@myparcel/ts-utils';
import {resolvePath} from '../resolvePath';
import {reportFileDoesNotExist, reportFileExists} from '../debug/reportOnFile';
import {logTargetPath} from '../debug/logTargetPath';
import {logSourcePath} from '../debug/logSourcePath';
import {isVeryVeryVerbose} from '../command/isVeryVeryVerbose';
Expand All @@ -19,12 +18,10 @@ export const renameFile = async (
const resolvedTarget = resolvePath(target, context);

if (!(await exists(resolvedSource))) {
reportFileDoesNotExist(resolvedSource, context);
return;
}

if (await exists(resolvedTarget)) {
reportFileExists(resolvedTarget, context);
return;
}

Expand Down
2 changes: 0 additions & 2 deletions apps/app-builder/src/utils/validateDistPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ import {type PdkBuilderContextWithPlatformArgs} from '../types/command.types';
import {COMMAND_COPY_NAME} from '../constants';
import {getPlatformDistPath} from './getPlatformDistPath';
import {exists} from './fs/exists';
import {reportDirectoryDoesNotExist} from './debug/reportOnFile';
import {isDryRun} from './command/isDryRun';

export const validateDistPath = async (context: PdkBuilderContextWithPlatformArgs): Promise<boolean> => {
const platformDistPath = getPlatformDistPath(context);

if (!(await exists(platformDistPath))) {
if (isDryRun(context)) {
reportDirectoryDoesNotExist(platformDistPath, context);
return false;
}

Expand Down

0 comments on commit 6a5cf1e

Please sign in to comment.