Skip to content

Commit

Permalink
fix: make builtin not try to delete
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Aug 27, 2022
1 parent 5af5e41 commit fbe1886
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ public List<BundleInfo> list() {

public Boolean delete(final String id, final Boolean removeInfo) throws IOException {
final BundleInfo deleted = this.getBundleInfo(id);
if (deleted.isBuiltin()) {
return false;
}
final File bundle = new File(this.documentsDir, bundleDirectory + "/" + id);
if (bundle.exists()) {
this.deleteDirectory(bundle);
Expand Down
3 changes: 3 additions & 0 deletions ios/Plugin/CapacitorUpdater.swift
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ extension CustomError: LocalizedError {

public func delete(id: String, removeInfo: Bool) -> Bool {
let deleted: BundleInfo = self.getBundleInfo(id: id)
if (deleted.isBuiltin()) {
return false
}
let destHot = documentsDir.appendingPathComponent(bundleDirectoryHot).appendingPathComponent(id)
let destPersist = libraryDir.appendingPathComponent(bundleDirectory).appendingPathComponent(id)
do {
Expand Down

0 comments on commit fbe1886

Please sign in to comment.