@@ -85,24 +85,36 @@ public Path realpath(Object path) {
8585
8686 @ Override
8787 public void chown (boolean sudo , boolean recursive , String owner , String target ) {
88- String options = "" ;
88+ final List <Object > args = new ArrayList <>();
89+ args .add ("chown" );
90+
8991 if (recursive ) {
90- options = "-R" ;
92+ args . add ( "-R" ) ;
9193 }
9294
93- sshExec (sudo , false , "chown" , options , owner , target ).run ();
95+ args .add (owner );
96+ args .add (target );
97+
98+ this .sshExec (sudo , false , args .toArray ())
99+ .run ();
94100
95101 log .info ("Set owner to {} for {}" , owner , target );
96102 }
97103
98104 @ Override
99105 public void chmod (boolean sudo , boolean recursive , String permissions , String target ) {
100- String options = "" ;
106+ final List <Object > args = new ArrayList <>();
107+ args .add ("chmod" );
108+
101109 if (recursive ) {
102- options = "-R" ;
110+ args . add ( "-R" ) ;
103111 }
104112
105- sshExec (sudo , false , "chmod" , options , permissions , target ).run ();
113+ args .add (permissions );
114+ args .add (target );
115+
116+ this .sshExec (sudo , false , args .toArray ())
117+ .run ();
106118
107119 log .info ("Set perms to {} for {}" , permissions , target );
108120 }
@@ -376,12 +388,7 @@ private void installSysvDaemon(Deployment install, Daemon daemon, boolean onBoot
376388 }
377389
378390 private void installSystemdDaemon (Deployment install , Daemon daemon , boolean onBoot ) {
379-
380-
381391 // upload modified file to target, then copy it over
382-
383-
384-
385392 String sourceServiceFile = install .getCurrentDir () + "/share/systemd/" + daemon .getName () + ".service" ;
386393 String serviceFile = "/etc/systemd/system/" + daemon .getName () + ".service" ;
387394 copyFiles (true , sourceServiceFile , serviceFile );
0 commit comments