Skip to content

Commit 1ea9f77

Browse files
feat. cleanup before installing
1 parent cc007e9 commit 1ea9f77

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/plugins/terminal/www/Terminal.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,15 @@ const Terminal = {
9191
* @returns {Promise<boolean>} - Returns true if installation completes with exit code 0
9292
*/
9393
async install(logger = console.log, err_logger = console.error) {
94-
if (await this.isInstalled()) return true;
9594
if (!(await this.isSupported())) return false;
9695

96+
try {
97+
//cleanup before insatll
98+
await this.uninstall();
99+
} catch (e) {
100+
//supress error
101+
}
102+
97103
const filesDir = await new Promise((resolve, reject) => {
98104
system.getFilesDir(resolve, reject);
99105
});

0 commit comments

Comments
 (0)