Skip to content

Commit

Permalink
Merge pull request #1263 from Accenture/bug/1229-number-of-downloaded…
Browse files Browse the repository at this point in the history
…-assets-not-visible-in-vscode-extensions-output-window

Bug/1229 number of downloaded assets not visible in vscode extensions output window
  • Loading branch information
JoernBerkefeld authored Apr 15, 2024
2 parents 2858c1a + 56f4277 commit 23db15a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 5 additions & 1 deletion lib/metadataTypes/Asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,11 @@ class Asset extends MetadataType {
}
// we have to wait on execution or it potentially causes memory reference issues when changing between BUs
await this.requestAndSaveExtended(items, subType, retrieveDir, templateVariables);
Util.logger.debug(`Downloaded asset-${subType}: ${items.length}`);
if (Util.isRunViaVSCodeExtension) {
Util.logger.info(` Downloaded asset-${subType}: ${items.length}`);
} else {
Util.logger.debug(`Downloaded asset-${subType}: ${items.length}`);
}
} else if (retrieveDir && !items.length) {
Util.logger.info(` Downloaded asset-${subType}: ${items.length}`);
}
Expand Down
6 changes: 4 additions & 2 deletions lib/util/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
* Util that contains logger and simple util methods
*/
export const Util = {
isRunViaVSCodeExtension:
process.env.VSCODE_AMD_ENTRYPOINT === 'vs/workbench/api/node/extensionHostProcess' || // run via VSCode extension
process.env.VSCODE_CRASH_REPORTER_PROCESS_TYPE === 'extensionHost',
authFileName: '.mcdev-auth.json',
boilerplateDirectory: '../../boilerplate',
configFileName: '.mcdevrc.json',
Expand Down Expand Up @@ -275,8 +278,7 @@ export const Util = {
// silly: 6
// }
if (
process.env.VSCODE_AMD_ENTRYPOINT === 'vs/workbench/api/node/extensionHostProcess' || // run via VSCode extension
process.env.VSCODE_CRASH_REPORTER_PROCESS_TYPE === 'extensionHost' || // run via VSCode extension
this.isRunViaVSCodeExtension || // run via VSCode extension
process.env.FORK_PROCESS_ID || // run via Git-Fork
process.env.PATH.toLowerCase().includes('sourcetree') // run via Atlassian SourceTree
) {
Expand Down
5 changes: 1 addition & 4 deletions test/resourceFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ const attributeParser = new XMLParser({ ignoreAttributes: false });
let color;

/* eslint-disable unicorn/prefer-ternary */
if (
process.env.VSCODE_AMD_ENTRYPOINT === 'vs/workbench/api/node/extensionHostProcess' ||
process.env.VSCODE_CRASH_REPORTER_PROCESS_TYPE === 'extensionHost'
) {
if (Util.isRunViaVSCodeExtension) {
// when we execute the test in a VSCode extension host, we don't want CLI color codes.
// @ts-expect-error hacky way to get rid of colors - ts doesn't appreciate the hack
color = new Proxy(
Expand Down

0 comments on commit 23db15a

Please sign in to comment.