Files
Pier_v1/.hmcmkit/tools/archive.py
T
ahnyongjooandClaude Sonnet 5.5 964a841de1 chore(rebar): Pier_T_rebar 작업 폴더 초기 구성 및 외부 의존 파일 통합
- Code\rebar_pipeline, review_pipeline, pier-program을 정션에서 실제 폴더로 전환
- Code\rhino_mcp 및 CLAUDE_rhino배경.md 추가, .mcp.json은 PYTHONPATH로 새 위치 사용
- pier-program 내부 .git 제거(이력은 backup\pier-program_20261028.bundle에 보관)
- worktree 가이드 반영(CLAUDE.local.md, HANDOFF.md)
- D:\Rhino-MCP 경로 참조를 새 위치로 치환

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-28 11:20:18 +09:00

54 lines
1.6 KiB
Python

import os
import sys
import shutil
import glob
def archive_feature(feature_name):
archive_root = "archive"
target_dir = os.path.join(archive_root, feature_name)
print(f"Archiving feature '{feature_name}' to {target_dir}...")
if not os.path.exists(target_dir):
os.makedirs(target_dir)
# Find all files related to this feature
# Convention: {feature}.*.md or inside feature folders
patterns = [
f"docs/**/*{feature_name}*.md",
f"src/**/*{feature_name}*"
]
moved_count = 0
for pattern in patterns:
# Recursive glob
files = glob.glob(pattern, recursive=True)
for src in files:
if os.path.isdir(src): continue
# mirror logic logic is complex, for v1.0 let's just flatten or simple move
# Simple move: archive/{feature}/{original_basename}
basename = os.path.basename(src)
dst = os.path.join(target_dir, basename)
try:
shutil.move(src, dst)
print(f" Moved: {src} -> {dst}")
moved_count += 1
except Exception as e:
print(f" Error moving {src}: {e}")
if moved_count > 0:
print(f"✅ Successfully archived {moved_count} files.")
else:
print("⚠️ No files found to archive.")
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: python archive.py <feature_name>")
sys.exit(1)
archive_feature(sys.argv[1])