🐛 Fix(custom): optimize github remote delete

ISSUES CLOSED: #158
This commit is contained in:
Kuingsmile 2024-02-07 05:46:25 -08:00
parent 914ec15361
commit 0767fbcea4

View File

@ -19,9 +19,10 @@ export default class GithubApi {
} }
private static createKey (path: string | undefined, fileName: string): string { private static createKey (path: string | undefined, fileName: string): string {
const formatedFileName = fileName.replace(/%2F/g, '/')
return path && path !== '/' return path && path !== '/'
? `${path.replace(/^\/+|\/+$/, '')}/${fileName}` ? `${path.replace(/^\/+|\/+$/, '')}/${formatedFileName}`
: fileName : formatedFileName
} }
static async delete (configMap: IConfigMap): Promise<boolean> { static async delete (configMap: IConfigMap): Promise<boolean> {