Skip to content

Commit

Permalink
Import: properly restore original working dir
Browse files Browse the repository at this point in the history
  • Loading branch information
themitosan committed Dec 10, 2024
1 parent f7195d3 commit a8a4700
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export async function grpp_startImport(cloneURL:string){
runExternalCommand('git config remote.origin.fetch "+refs/*:refs/*"', { ...runExternalCommand_Defaults, chdir: repoPath });
})
.then(function(){
process.chdir(originalCwd);
grpp_updateRepoData(`${urlData[2]}/${owner}/${name}`, currentRepo);
createLogEntry(grpp_convertLangVar(langDatabase.import.cloneProcessComplete, [name, repoPath]));
resolve();
Expand All @@ -135,13 +136,11 @@ export async function grpp_batchImport(urlList:string){
// Clear screen, create url array and starrt clone process
grpp_displayMainLogo(!0);
const
originalCwd = structuredClone(process.cwd()),
urlArray = urlList.split('\n');
for (const url of urlArray){
if (url.length > 0){
createLogEntry(grpp_convertLangVar(langDatabase.import.batchCurrentRepo, [(urlArray.indexOf(url) + 1), urlArray.length, url]));
await grpp_startImport(url);
process.chdir(originalCwd);
}
}

Expand Down

0 comments on commit a8a4700

Please sign in to comment.