mirror of
https://github.com/tiktok/sparo.git
synced 2024-11-27 09:36:04 -05:00
chore: remove replace github hostname
This commit is contained in:
parent
fdfaf6b72b
commit
aba31e0c9b
2 changed files with 5 additions and 15 deletions
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue