/
scm.ts
47 lines (42 loc) · 1.32 KB
/
scm.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* istanbul ignore file */
import { glob } from 'glob';
import type { CommitFilesConfig, CommitSha } from '../../../util/git/types';
import type { PlatformScm } from '../types';
let fileList: string[] | undefined;
export class LocalFs implements PlatformScm {
fileList: string[] | undefined;
isBranchBehindBase(branchName: string, baseBranch: string): Promise<boolean> {
return Promise.resolve(false);
}
isBranchModified(branchName: string): Promise<boolean> {
return Promise.resolve(false);
}
isBranchConflicted(baseBranch: string, branch: string): Promise<boolean> {
return Promise.resolve(false);
}
branchExists(branchName: string): Promise<boolean> {
return Promise.resolve(true);
}
getBranchCommit(branchName: string): Promise<string | null> {
return Promise.resolve(null);
}
deleteBranch(branchName: string): Promise<void> {
return Promise.resolve();
}
commitAndPush(commitConfig: CommitFilesConfig): Promise<string | null> {
return Promise.resolve(null);
}
async getFileList(): Promise<string[]> {
fileList ??= await glob('**', {
dot: true,
nodir: true,
ignore: {
childrenIgnored: (p) => p.isNamed('.git'),
},
});
return fileList;
}
checkoutBranch(branchName: string): Promise<CommitSha> {
return Promise.resolve('');
}
}