filefive
Version:
SFTP/FTP/Amazon S3 client and dual-panel file manager for macOS and Linux
24 lines (23 loc) • 751 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const URI_1 = require("../utils/URI");
const RemoteFiles_1 = require("../RemoteFiles");
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/${path}`);
}
else {
opener(path);
}
return '';
}
else {
return (0, RemoteFiles_1.open)(file, path => opener(app == 'code' ? `vscode://file/${path}` : path));
}
}