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

Method deleteFiles

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

Source from the content-addressed store, hash-verified

967 }
968
969 async deleteFiles(paths: string[], message: string) {
970 if (this.useOpenAuthoring) {
971 return Promise.reject('Cannot delete published entries as an Open Authoring user!');
972 }
973
974 const branchData = await this.getDefaultBranch();
975 const files = paths.map(path => ({ path, sha: null }));
976 const changeTree = await this.updateTree(branchData.commit.sha, files);
977 const commit = await this.commit(message, changeTree);
978 await this.patchBranch(this.branch, commit.sha);
979 }
980
981 async createBranchAndPullRequest(branchName: string, sha: string, commitMessage: string) {
982 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