MCPcopy Create free account
hub / github.com/decaporg/decap-cms / deleteFiles

Method deleteFiles

packages/decap-cms-backend-github/src/API.ts:994–1004  ·  view source on GitHub ↗
(paths: string[], message: string)

Source from the content-addressed store, hash-verified

992 }
993
994 async deleteFiles(paths: string[], message: string) {
995 if (this.useOpenAuthoring) {
996 return Promise.reject('Cannot delete published entries as an Open Authoring user!');
997 }
998
999 const branchData = await this.getDefaultBranch();
1000 const files = paths.map(path => ({ path, sha: null }));
1001 const changeTree = await this.updateTree(branchData.commit.sha, files);
1002 const commit = await this.commit(message, changeTree);
1003 await this.patchBranch(this.branch, commit.sha);
1004 }
1005
1006 async createBranchAndPullRequest(branchName: string, sha: string, commitMessage: string) {
1007 await this.createBranch(branchName, sha);

Callers

nothing calls this directly

Calls 5

getDefaultBranchMethod · 0.95
updateTreeMethod · 0.95
commitMethod · 0.95
patchBranchMethod · 0.95
mapMethod · 0.80

Tested by

no test coverage detected