15 lines
339 B
Bash
Executable File
15 lines
339 B
Bash
Executable File
#!/bin/sh
|
|
set -euf
|
|
set -x
|
|
|
|
tmp="$(mktemp -d)"
|
|
tar -x -C "$tmp" -f "$1"
|
|
find "$tmp" -name 'asset' -exec sh -c '
|
|
SRC="$1"
|
|
DESTFILE="$(cat "${SRC%/*}/pathname" | sed -E -e '\''s,^\.\./,,'\'' -e '\''s,/\.\./,/,g'\'')"
|
|
echo "$DESTFILE"
|
|
mkdir -p "UNITYEXTRACT/${DESTFILE%/*}"
|
|
mv -i "$SRC" "UNITYEXTRACT/$DESTFILE"
|
|
' sh {} \;
|
|
rm -rf "$tmp"
|