intial take on fixing the file type

- upload file in a safer way
- remove destination if it is not a file
- only set attributes if required

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
first generate and execute *-local, then *-remote

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
fix quoting, remove redundant code

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
no late delete

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
Revert "first generate and execute *-local, then *-remote"

This reverts commit cf22499538266b1b4fac1694254edfd8ba9be68d.
refactor so that there is no interaction between code-local and code-remote

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
++changes(2.3.7)

Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>