pressly / sup

Super simple deployment tool - think of it like 'make' for a network of servers
https://pressly.github.io/sup
MIT License
2.48k stars 178 forks source link

LocalTar: Don't create intermediate bash process #58

Closed juergenhoetzel closed 8 years ago

juergenhoetzel commented 8 years ago

Fixes issues with whitespace or special shell characters in path or excludes.

Also fixes portability issues: Bash is not the default shell on *BSD systems.

VojtechVitek commented 8 years ago

Thanks for the contribution, @juergenhoetzel.

I tested your changes and I get this error:

$ sup development config
user@example.com:22 | + tar -C /tmp/ -xzf -
user@example.com:22 |
user@example.com:22 | gzip: stdin: decompression OK, trailing garbage ignored
user@example.com:22 | tar: Child returned status 2
user@example.com:22 | tar: Error is not recoverable: exiting now
user@example.com:22 | exit 2
juergenhoetzel commented 8 years ago

$ sup development config user@example.com:22 | + tar -C /tmp/ -xzf - user@example.com:22 | user@example.com:22 | gzip: stdin: decompression OK, trailing garbage ignored user@example.com:22 | tar: Child returned status 2 user@example.com:22 | tar: Error is not recoverable: exiting now user@example.com:22 | exit 2

@VojtechVitek The Environment isn't passed in my branch: So the

      - src: ./example.$SUP_NETWORK.cfg

will not be substituted.

I will close this request. It will not work if you use environment variables.

A proper solution needs to handle environment variables in a cross-platform way as described: https://github.com/pressly/sup/issues/59

VojtechVitek commented 8 years ago

Interesting, so that's why I probably used bash instead of tar in the first place. I should have documented it better.

I wonder if we could substitute the env vars locally for file names and use tar/rsync directly. Thanks for investigating this issue.