chore: remove replace github hostname

This commit is contained in:
Cheng Liu 2024-03-11 16:34:12 -07:00
parent fdfaf6b72b
commit aba31e0c9b
No known key found for this signature in database
GPG key ID: EEC8452F7DB85CD6
2 changed files with 5 additions and 15 deletions

View file

@ -20,10 +20,7 @@ export async function runAsync(runScriptOptions: IRunScriptOptions): Promise<voi
} = runScriptOptions;
const temporaryDirectory: string = path.resolve(buildFolderPath, 'temp');
let testRepoURL: string = 'git@github.com:tiktok/sparo.git';
if (production) {
testRepoURL = 'https://github.com/tiktok/sparo.git';
}
const testRepoURL: string = 'https://github.com/tiktok/sparo.git';
const repoFolder: string = path.resolve(temporaryDirectory, 'sparo');
await FileSystem.deleteFolderAsync(repoFolder);

View file

@ -107,10 +107,10 @@ export async function executeCommandsAndCollectOutputs({
const outputPath: string = path.join(tempFolder, `${name}.txt`);
FileSystem.writeFile(
outputPath,
processSparoOutput(
`Running "sparo ${args.join(' ')}":\n${stdout}`,
`Running "sparo ${args.join(' ')}":\n${processSparoOutput(
stdout,
currentWorkingDirectory || process.cwd()
)
)}`
);
break;
}
@ -263,8 +263,7 @@ function processSparoOutput(text: string, workingDirectory: string): string {
replaceVersionString,
replaceDurationString,
replaceWorkingDirectoryPath,
replaceFolderCountString,
replaceGitHubHostname
replaceFolderCountString
].reduce((text, fn) => fn(text, workingDirectory), text);
}
/**
@ -291,12 +290,6 @@ 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 replaceGitHubHostname(text: string): string {
return text.replace(/(https?:\/\/|git\@)github\.com[/:]/g, '__GITHUB_HOSTNAME__');
}
async function* enumerateFolderPaths(
absoluteFolderPath: string,