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

Multi line description when editing is not working #24

Open
ctitof137 opened this issue Jun 19, 2019 · 1 comment
Open

Multi line description when editing is not working #24

ctitof137 opened this issue Jun 19, 2019 · 1 comment

Comments

@ctitof137
Copy link

Hi,
I am trying to edit a file with a description that is on multiple line. As this is getting picked up by some automated tools, i need to make sure it is on multiple line.

The following will return an error:
_```
build_description="
First Line\n
Second Line\n
Third Line\n
"

p4.changelist.create({description: build_description}, function (err, changelist) {
if (err) return console.log(err);


I was able to fix it locally. I have never contributed so I'm not sure what the process is so here is what I did to fix it:
`
  if (ob.stdin.length > 0) {
    ob.stdin.forEach(function (line) {
      // for multline field, the first line goes in as is, and the following need to start with a tab
      let multiline = line.split('\n')
      child.stdin.write(multiline[0] + '\n');
      multiline.shift();
      multiline.forEach(function (l) {
        child.stdin.write('\t' + l + '\n');
      });
    });
    child.stdin.emit('end');
  }
`
Bascially, I followed how they are doing with the files for multilines, which is to add a tab for each new line that belongs to the same tag.

@RecklessWave
Copy link

I've integrated your fix into this fork of the project:

https://github.com/RecklessWave/reckless-node-perforce
https://www.npmjs.com/package/reckless-node-perforce

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

2 participants