MMCTL: Add import delete cmd for removing the import files (#29764)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
0cf6361139
Коммит
09a2037b61
@@ -410,3 +410,15 @@ func (a *App) ListImports() ([]string, *model.AppError) {
|
||||
|
||||
return results, nil
|
||||
}
|
||||
|
||||
func (a *App) DeleteImport(name string) *model.AppError {
|
||||
filePath := filepath.Join(*a.Config().ImportSettings.Directory, name)
|
||||
|
||||
if ok, err := a.FileExists(filePath); err != nil {
|
||||
return err
|
||||
} else if !ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
return a.RemoveFile(filePath)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user