More portable pane_capture archiving

This commit is contained in:
Bruno Sutic 2015-07-10 19:29:40 +02:00
parent a47236d247
commit e81f8e5f37
No known key found for this signature in database
GPG Key ID: 66D96E4F2F7EF26C
2 changed files with 5 additions and 2 deletions

View File

@ -14,6 +14,7 @@
feature) feature)
- "save pane contents" feature saves files to a separate directory - "save pane contents" feature saves files to a separate directory
- archive and compress pane contents file - archive and compress pane contents file
- make archive & compress pane contents process more portable
### v2.4.0, 2015-02-23 ### v2.4.0, 2015-02-23
- add "tmux-test" - add "tmux-test"

View File

@ -74,13 +74,15 @@ is_session_grouped() {
# pane content file helpers # pane content file helpers
pane_contents_create_archive() { pane_contents_create_archive() {
tar czf "$(pane_contents_archive_file)" -C "$(resurrect_dir)" ./pane_contents/ tar cf - -C "$(resurrect_dir)" ./pane_contents/ |
gzip > "$(pane_contents_archive_file)"
} }
pane_content_files_restore_from_archive() { pane_content_files_restore_from_archive() {
local archive_file="$(pane_contents_archive_file)" local archive_file="$(pane_contents_archive_file)"
if [ -f "$archive_file" ]; then if [ -f "$archive_file" ]; then
tar xzf "$archive_file" -C "$(resurrect_dir)" gzip -d < "$archive_file" |
tar xf - -C "$(resurrect_dir)"
fi fi
} }