filesystem-sandbox 1.25.0 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -79,9 +79,14 @@ class Sandbox {
|
|
|
79
79
|
return this._path;
|
|
80
80
|
}
|
|
81
81
|
async destroy() {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
try {
|
|
83
|
+
await this.tryDestroySelf();
|
|
84
|
+
await this.tryDestroyContainer();
|
|
85
|
+
await this.tryDestroyAt();
|
|
86
|
+
}
|
|
87
|
+
catch (e) {
|
|
88
|
+
console.warn(`sandbox destruction did not complete - if you see this regularly, please raise an issue`, e);
|
|
89
|
+
}
|
|
85
90
|
}
|
|
86
91
|
async tryDestroyAt() {
|
|
87
92
|
if (!this._at) {
|
|
@@ -93,7 +98,7 @@ class Sandbox {
|
|
|
93
98
|
await this.destroyFolderIfEmpty(this._base);
|
|
94
99
|
}
|
|
95
100
|
async destroyFolderIfEmpty(p) {
|
|
96
|
-
const contents = await
|
|
101
|
+
const contents = await (0, yafs_1.ls)(p);
|
|
97
102
|
if (!contents.length) {
|
|
98
103
|
await (0, yafs_1.rm)(p);
|
|
99
104
|
}
|