filefive
Version:
SFTP/FTP/Amazon S3 client and dual-panel file manager for macOS and Linux
26 lines (25 loc) • 640 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const URI_1 = require("../utils/URI");
const Local_1 = require("../Local");
async function default_1(uri, local, remote, file) {
if ((0, URI_1.isLocal)(uri)) {
const { path } = (0, URI_1.parseURI)(uri);
const f = (0, Local_1.stat)(path);
if (f) {
if (f.dir) {
local.watch(path);
}
else {
file.watch(path);
}
}
else {
local.watch(path);
}
}
else {
remote.watch(uri);
}
}