Tucker McKnight
remove the generic operations class, just go with git operations
7
import repoOperations from './src/vcses/operations.ts'
7
import * as operations from './src/vcses/git/operations.ts'
181 182
const config = reposConfiguration.repos[repo]
return repoOperations[config._type].getFileLastTouchInfo(branch, filename, location)
181 182
return operations.getFileLastTouchInfo(branch, filename, location)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
import {
getFileList as getGitFileList,
getFileLastTouchInfo as getGitFileLastTouchInfo,
} from './git/operations.ts'
type RepoOperationsType = {
[vcs: string]: {
getFileList: (repoName: string, branchName: string, repoLocation: string) => Promise<Array<string>>,
getFileLastTouchInfo: (branchName: string, filename: string, repoLocation: string) => Promise<Array<{sha: string, author: string}>>,
}
}
const repoOperations: RepoOperationsType = {
git: {
getFileList: getGitFileList,
getFileLastTouchInfo: getGitFileLastTouchInfo,
},
}
export default repoOperations
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20