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

Path with spaces don't get processed correctly #25

Open
JakeBelanger opened this issue Oct 22, 2020 · 4 comments
Open

Path with spaces don't get processed correctly #25

JakeBelanger opened this issue Oct 22, 2020 · 4 comments

Comments

@JakeBelanger
Copy link

JakeBelanger commented Oct 22, 2020

Wrap the file names and paths with double quotes in runCommand so that they get interpreted correctly. The following worked for me:

runCommand(cmd, path, destination) {
    let workingDir = p.dirname(path);
    let fileName = p.basename(path).replace(singleSlash, '\\');
    let cmdArgs = `"${fileName}" "${destination}"`;

    return this.execute(cmd, cmdArgs, workingDir);
}
@nickperkinslondon
Copy link

Yes please. This is absolutely necessary. Lots of windows filenames have spaces in them -- it's very common! I can make it work by adding my own quotes, but it should happen automatically.

@jakesjews
Copy link
Member

I'll definitely accept a PR for this if anyone wants to try it out

@jakesjews
Copy link
Member

@nickperkinslondon can you see if version 4 fixes your issue?

@JakeBelanger
Copy link
Author

JakeBelanger commented Feb 12, 2021

It works, but now it brings up the issue of having to escape single and double quotes in file names. I haven't figured out how to do that properly, so for my use case, I just clean the file names before sending them. However, I do think a fully fledged samba client should be able to send those files without a problem.

Thanks for your work!

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

No branches or pull requests

3 participants