diff --git a/apps/sparo-lib/src/cli/commands/list-profiles.ts b/apps/sparo-lib/src/cli/commands/list-profiles.ts index f706ec8..e7636be 100644 --- a/apps/sparo-lib/src/cli/commands/list-profiles.ts +++ b/apps/sparo-lib/src/cli/commands/list-profiles.ts @@ -73,9 +73,12 @@ export class ListProfilesCommand implements ICommand x, Sort.compareByValue); terminalService.terminal.writeLine( - `${project} was included in the below profiles:\n ${profileProjects.get(project)?.join('\n')}` + `${project} was included in the below profiles:\n ${profilesContainProject.join('\n')}` ); } else { terminalService.terminal.writeErrorLine(`${project} is not included in any pre-configured profile`); diff --git a/build-tests/sparo-real-repo-test/etc/clone.txt b/build-tests/sparo-real-repo-test/etc/clone.txt index f17554e..8d96599 100644 --- a/build-tests/sparo-real-repo-test/etc/clone.txt +++ b/build-tests/sparo-real-repo-test/etc/clone.txt @@ -1,4 +1,4 @@ -Running "sparo clone git@github.com:tiktok/sparo.git --branch build-test": +Running "sparo clone __GITHUB_HOSTNAME__:tiktok/sparo.git --branch build-test": Sparo accelerator for Git __VERSION__ - https://tiktok.github.io/sparo/ Node.js version is __VERSION__ (LTS) diff --git a/build-tests/sparo-real-repo-test/etc/list-profiles-with-project.txt b/build-tests/sparo-real-repo-test/etc/list-profiles-with-project.txt index 913c869..523d419 100644 --- a/build-tests/sparo-real-repo-test/etc/list-profiles-with-project.txt +++ b/build-tests/sparo-real-repo-test/etc/list-profiles-with-project.txt @@ -17,5 +17,5 @@ Checking out skeleton... ------------------------------------------------------------------------------- sparo-lib was included in the below profiles: - sparo-development -my-build-test + my-build-test +sparo-development diff --git a/build-tests/test-utilities/src/index.ts b/build-tests/test-utilities/src/index.ts index 428f06d..050dd92 100644 --- a/build-tests/test-utilities/src/index.ts +++ b/build-tests/test-utilities/src/index.ts @@ -107,10 +107,10 @@ export async function executeCommandsAndCollectOutputs({ const outputPath: string = path.join(tempFolder, `${name}.txt`); FileSystem.writeFile( outputPath, - `Running "sparo ${args.join(' ')}":\n${processSparoOutput( - stdout, + processSparoOutput( + `Running "sparo ${args.join(' ')}":\n${stdout}`, currentWorkingDirectory || process.cwd() - )}` + ) ); break; } @@ -263,7 +263,8 @@ function processSparoOutput(text: string, workingDirectory: string): string { replaceVersionString, replaceDurationString, replaceWorkingDirectoryPath, - replaceFolderCountString + replaceFolderCountString, + replaceGitHostname ].reduce((text, fn) => fn(text, workingDirectory), text); } /** @@ -290,6 +291,12 @@ function replaceWorkingDirectoryPath(text: string, workingDirectory: string): st function replaceFolderCountString(text: string): string { return text.replace(/Checking out \d+ folders/g, 'Checking out __FOLDER_COUNT__ folders'); } +/** + * Replace "https://github.com" and "git@github.com" with "__GITHUB_HOSTNAME__". + */ +function replaceGitHostname(text: string): string { + return text.replace(/(https?:\/\/|git\@)github\.com/g, '__GITHUB_HOSTNAME__'); +} async function* enumerateFolderPaths( absoluteFolderPath: string,