add remove repository function

This commit is contained in:
Tejas Srikanth 2023-03-18 17:39:29 -04:00
parent c4421bcd9f
commit dbfed75287
2 changed files with 7 additions and 2 deletions

View File

@ -53,3 +53,7 @@ function createAndPublishNewBranch(repoPath){
}
)
}
export function removeRepo(repoPath){
exec("rm -r "+repoPath);
}

View File

@ -1,12 +1,13 @@
import { exec } from 'child_process';
import { SimpleConsoleLogger } from 'typeorm'
import {cloneRepo, commitRepo, pushRepo} from './gitClient'
import {cloneRepo, commitRepo, pushRepo, removeRepo} from './gitClient'
//Sample usage
cloneRepo('https://git.csclub.uwaterloo.ca/www/library.git', (temporaryDir) => {
//temporaryDir is the temp directory name
// exec("touch "+ temporaryDir + "/thing.js"); (add a new file to the directory)
commitRepo(temporaryDir); // commit to the directory
pushRepo(temporaryDir); // push to the directory
removeRepo(temporaryDir); // remove the directory
});