13 lines
1.4 KiB
Python
13 lines
1.4 KiB
Python
from pathlib import Path
|
|
import shutil,subprocess
|
|
r=Path.cwd();o=Path(__file__).resolve().parent;q=Path('C:/Users/macbook/.config/investmoz/editorial-QA-20261018/source');c=q.parent/'compatible-reversal'
|
|
assert not c.exists();c.mkdir()
|
|
for folder in ['app','config','routes','database','resources','bootstrap']:shutil.copytree(q/folder,c/folder)
|
|
for name in ['.env','composer.json','composer.lock','package.json','package-lock.json','tsconfig.json','vite.config.ts']:shutil.copy2(q/name,c/name)
|
|
for folder in ['storage/framework/views','storage/framework/sessions','storage/framework/cache/data','storage/logs','public']:(c/folder).mkdir(parents=True,exist_ok=True)
|
|
for name in ['vendor','node_modules']:subprocess.run(['powershell','-NoProfile','-Command',f"New-Item -ItemType Junction -Path '{c/name}' -Target '{r/name}' | Out-Null"],check=True,capture_output=True)
|
|
# Recover only the old management UI and old sector writer. Keep the new public readers/routes/schema/history.
|
|
for name in ['resources/js/pages/portal/manage.tsx','resources/js/pages/management/editor.tsx','app/Http/Controllers/PortalManagementController.php']:shutil.copy2(r/name,c/name)
|
|
v=c/'vite.config.ts';v.write_text(v.read_text('utf8').replace('...(!qaBuild ? [wayfinder({ formVariants: true })] : []),','...[],'),'utf8')
|
|
print('Compatible reversal prepared: previous management screens; new public article readers and data retained')
|