BurningTimesAi/공유/기획/FirstRising/맵/tools/revert_unintended.sh

30 lines
1.7 KiB
Bash

#!/bin/bash
# 에디터가 덧붙인 의도치 않은 에셋 변경을 백업한 뒤 되돌리고, 에디터가 다시 읽게 한다(편집 모드에서만).
# · 09-27 부터 있던 6개(PD 판단 대기)는 건드리지 않는다.
# · 되돌리는 것: 그 밖의 재질 · 글자체 가운데, 이번 작업이 일부러 고친 것이 아닌 것(아래 KEEP 에 없는 것).
SP="C:/Users/sw/AppData/Local/Temp/claude/E--BurningTimes/3562a2c1-e88a-4143-b7ec-e74c317778d8/scratchpad"
source "$SP/bt.sh"
export PYTHONIOENCODING=utf-8
cd "$P" || exit 1
STAMP=$(date +%Y%m%d_%H%M)
B="E:/BurningTimes/공유/개발팀_백업/FirstRising/unintended_$STAMP"
# 09-27 부터 있던 것 — 그대로 둔다
HOLD='FlashGroundCG.mat|MagicCircle38bcg.mat|Point12cg.mat|Smoke3cg.mat|GlobalEntitySceneDependency.asset|NanumGothic/NanumGothic SDF.asset'
LIST=$(git status --porcelain | grep '^ M' | sed 's/^ M //' | tr -d '"' | grep -E '\.mat$|SDF\.asset$' | grep -Ev "$HOLD" | grep -v '^Assets/BurningTimes/') # 우리 폴더의 재질은 빌더가 일부러 고친 것이다(알파 사본 등) — 되돌리지 않는다
if [ -z "$LIST" ]; then echo "되돌릴 것 없음"; exit 0; fi
st
mkdir -p "$B"
ARGS=""
while IFS= read -r f; do
[ -z "$f" ] && continue
mkdir -p "$B/$(dirname "$f")"
cp "$f" "$B/$f"
git checkout -- "$f"
ARGS="$ARGS$f;"
echo "reverted $f"
done <<< "$LIST"
printf "%s" "$ARGS" > "$SP/eval/args.txt"
unity command eval_file --file "$SP/eval/reimport.cs" --project-path "$P" --format json --no-banner 2>&1 | grep -o '"result": *"[^"]*"' | head -2 | cut -c1-400
echo "backup $B"
git status --porcelain | grep -v "Assets/BurningTimes/\|Assets/Scenes/Maps/\|Assets/Scenes/TestVisual.unity\|Assets/GameAssets/LobbyPlayScene.prefab"