filefive
Version:
SFTP/FTP/Amazon S3 client and dual-panel file manager for macOS and Linux
25 lines (24 loc) • 828 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const URI_1 = require("../utils/URI");
const RemoteFiles_1 = require("../RemoteFiles");
const Local_1 = require("../Local");
async function default_1(file, app, opener) {
if ((0, URI_1.isLocal)(file)) {
const { id, path } = (0, URI_1.parseURI)(file);
if (app == 'code') {
// open files through protocol links
// vscode://file/<path>
// vscode-insiders://file/<path>
opener(`vscode://file/${(0, Local_1.osify)(path)}`);
}
else {
opener((0, Local_1.osify)(path));
}
return '';
}
else {
return (0, RemoteFiles_1.open)(file, path => opener(app == 'code' ? `vscode://file/${path}` : path));
}
}