-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VFS Archive support #190
base: master
Are you sure you want to change the base?
VFS Archive support #190
Conversation
@andersevenrud could you give this a look at some point? As far as I remember it's complete, I know it's been quite a while. The linter is failing due to the commits being made before Conventional Commits were enforced, so on merge we can just squash and use an appropriate message to satisfy that requirement. |
@@ -369,6 +369,11 @@ export const createWatchEvents = (method, args) => { | |||
pid: options.pid | |||
}; | |||
|
|||
let target = args[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really sure if this belongs in this PR 🤔
@@ -330,6 +331,14 @@ export default class Filesystem extends EventEmitter { | |||
: result; | |||
}); | |||
} | |||
} else if (method === 'archive') { | |||
const [selection] = args; | |||
const mount = this.getMountpointFromPath(selection[0].path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will throw an exception if somehow an empty selection is supplied 🤔
Probably best to handle this.
Also, this condition can be removed and the stuff below can be changed to (excluding this check):
const [input] = args;
const file = method === 'archive' ? input[0].path : input;
const mount = this.getMountpointFromPath(file);
if (!mount) {
throw new Error('Failed to resolve mountpoint');
}
return VFS[method](mount._adapter, mount)(...args);
@@ -2197,20 +2197,21 @@ export type FilesystemMountpoint = { | |||
* Filesystem Adapter Methods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gah. I can't see if these are tabs or note here. But wasn't this fixed in another commit ?
Paired with os-js/osjs-server#64, this PR is meant to enable the use of archive functionality for the file manager application. Closes out #184 when merged, and will make progress towards closing out os-js/osjs-filemanager-application#39.
Closes #184