drone-ssh icon indicating copy to clipboard operation
drone-ssh copied to clipboard

Can't use comma in script/commands

Open SAprelov opened this issue 8 years ago • 8 comments

Dunno is it correct or not, but this line in my script section:

script:
  - echo "aaa,aaa,aaa"

always transforms in:

echo "aaa
aaa
aaa"

Guessing because of StringSlice call in https://github.com/appleboy/drone-ssh/blob/master/main.go#L171

But i need these commas. They must remain. Can i escape commas? Any solution?

SAprelov avatar Mar 31 '17 21:03 SAprelov

@SAprelov maybe you should change commas to another symbol. This https://github.com/urfave/cli/pull/605 PR can resolve your problem but the author of urfave/cli doesn't merge yet.

appleboy avatar Apr 01 '17 11:04 appleboy

Thanx for advice but no chance to use another symbol.

SAprelov avatar Apr 01 '17 11:04 SAprelov

Well. I have an ugly workaround. Just for the history: I am using env variable for ex. $COMMA=, and then inject it to the script like so

script:
  - echo "aaa$(echo $COMMA)aaa$(echo $COMMA)aaa"

And it works.

SAprelov avatar Apr 01 '17 19:04 SAprelov

@SAprelov Could we close this issue? Nice work.

appleboy avatar Apr 01 '17 23:04 appleboy

@appleboy believe yes. But please stay tune to https://github.com/urfave/cli/pull/605 issue. IMHO it is not correct to break lines. Other drone plugins dont do so.

SAprelov avatar Apr 02 '17 19:04 SAprelov

Please try v1.6.7 version.

appleboy avatar Dec 25 '22 07:12 appleboy

v1.7 still has problems, please have a check

Please try v1.6.7 version.

zbysir avatar Aug 16 '23 03:08 zbysir