Nest workspace under workspace/ in project backup
#9
@@ -206,8 +206,10 @@ pub async fn download_container_backup(
|
|||||||
// so secrets can't leak through the sanitization fallback.
|
// so secrets can't leak through the sanitization fallback.
|
||||||
// The `--transform` nests the workspace under `workspace/` (parallel to
|
// The `--transform` nests the workspace under `workspace/` (parallel to
|
||||||
// `home-claude/`) so an extracted archive has both clearly labeled instead
|
// `home-claude/`) so an extracted archive has both clearly labeled instead
|
||||||
// of scattering the workspace files into the extraction dir. `flags=r`
|
// of scattering the workspace files into the extraction dir. `flags=rh`
|
||||||
// scopes the rewrite to member names only, leaving symlink targets intact.
|
// rewrites regular member names AND hardlink target names (so an intra-
|
||||||
|
// workspace hardlink pair still resolves on extract) while leaving symlink
|
||||||
|
// targets untouched (rewriting those would corrupt relative/absolute links).
|
||||||
let script = r#"set -e
|
let script = r#"set -e
|
||||||
STAGE=$(mktemp -d)
|
STAGE=$(mktemp -d)
|
||||||
trap 'rm -rf "$STAGE"' EXIT
|
trap 'rm -rf "$STAGE"' EXIT
|
||||||
@@ -225,7 +227,7 @@ if [ -d "$HOME/.claude" ]; then
|
|||||||
fi
|
fi
|
||||||
tar czf - --ignore-failed-read \
|
tar czf - --ignore-failed-read \
|
||||||
--exclude='*/node_modules' --exclude='*/target' \
|
--exclude='*/node_modules' --exclude='*/target' \
|
||||||
--transform='flags=r;s,^\./,workspace/,' \
|
--transform='flags=rh;s,^\./,workspace/,' \
|
||||||
-C "$TC_BACKUP_SRC" . \
|
-C "$TC_BACKUP_SRC" . \
|
||||||
-C "$STAGE" home-claude"#;
|
-C "$STAGE" home-claude"#;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user