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

Some shell characters like '!' or '$' are not correctly escaped #62

Open
jodeka opened this issue May 29, 2022 · 0 comments
Open

Some shell characters like '!' or '$' are not correctly escaped #62

jodeka opened this issue May 29, 2022 · 0 comments

Comments

@jodeka
Copy link

jodeka commented May 29, 2022

Tested on: Manjaro Linux

On our project we have filenames like "!$xyz.png". This is due internal requirements in the "RPG Maker MV" game engine. Normal rsync command on bash does copy them without any issues. But with gulp-rsync and these files, we have errors like the following:

gulp-rsync: rsync: [sender] link_stat "!.png" failed: No such file or directory (2)

all other files are synced without any problems. gulp then finishes with a non zero exit code and these error messages:

gulp-rsync: rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1326) [sender=v3.2.4]

 Error in plugin "gulp-rsync"
Message:
    Error: rsync exited with code 23
    at ChildProcess.<anonymous> (node_modules/gulp-rsync/rsync.js:121:17)
    at ChildProcess.emit (node:events:527:28)
    at ChildProcess.emit (node:domain:537:15)
    at maybeClose (node:internal/child_process:1092:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
    at Process.callbackTrampoline (node:internal/async_hooks:130:17)
Details:
    domainEmitter: [object Object]
    domainThrown: false

probably the escapeShellArgs function should be replaced by something like shell-escape

function escapeShellArg(arg) {
  if (!/(["'`\\\(\) ])/.test(arg)) {
    return arg;
  }
  arg = arg.replace(/([\\])/g, '/');
  return '"' + arg.replace(/(["'`\\])/g, '\\$1') + '"';
}
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

1 participant