Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ajmeese7
Copy link
Member

@ajmeese7 ajmeese7 commented Aug 15, 2022

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

@ajmeese7
Copy link
Member Author

@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];
Copy link
Member

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);
Copy link
Member

@andersevenrud andersevenrud Nov 13, 2022

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
Copy link
Member

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VFS Archive support
2 participants