Skip to content

Commit 9163d1e

Browse files
committed
feat: add "Terminal Home" in acode file browser
Added " Terminal Home " in storage list in acode built in file browser for easy access of terminal files and workflow
1 parent 3839d9a commit 9163d1e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/pages/fileBrowser/fileBrowser.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,32 @@ function FileBrowserInclude(mode, info, doesOpenLast = true) {
10331033
);
10341034
}
10351035

1036+
// Check for Terminal Home Directory storage
1037+
try {
1038+
if (typeof Terminal !== "undefined" && Terminal.isInstalled) {
1039+
const isTerminalSupported = await Terminal.isSupported();
1040+
const isTerminalInstalled = await Terminal.isInstalled();
1041+
if (isTerminalSupported && isTerminalInstalled) {
1042+
const terminalHomeUrl = cordova.file.dataDirectory + "alpine/home";
1043+
1044+
// Check if this storage is not already in the list
1045+
const terminalStorageExists = allStorages.find(
1046+
(storage) =>
1047+
storage.uuid === "terminal-home" ||
1048+
storage.url === terminalHomeUrl,
1049+
);
1050+
1051+
if (!terminalStorageExists) {
1052+
util.pushFolder(allStorages, "Terminal Home", terminalHomeUrl, {
1053+
uuid: "terminal-home",
1054+
});
1055+
}
1056+
}
1057+
}
1058+
} catch (error) {
1059+
console.error("Error checking Terminal installation:", error);
1060+
}
1061+
10361062
try {
10371063
const res = await externalFs.listStorages();
10381064
res.forEach((storage) => {

0 commit comments

Comments
 (0)