17 lines
738 B
Python
17 lines
738 B
Python
"""Install the versioned custom forum profile adapter; no MyBB core changes."""
|
|
from pathlib import Path
|
|
import os
|
|
import subprocess
|
|
import sys
|
|
|
|
source=Path(__file__).resolve().parents[1]/'integrations/mybb/public-profile.php'
|
|
target=Path('/home/dunerealms/apps/integrations/mybb/public-profile.php')
|
|
subprocess.run(['php','-l',str(source)],check=True)
|
|
if '--apply' not in sys.argv:
|
|
print('Plan: install one custom forum profile adapter');sys.exit(0)
|
|
if os.geteuid()!=0:raise RuntimeError('Deployment operator required')
|
|
temporary=target.with_name(target.name+'.clan-new')
|
|
temporary.write_bytes(source.read_bytes())
|
|
temporary.chmod(0o644)
|
|
os.replace(temporary,target)
|
|
print('Installed custom clan emblem display below forum avatars')
|

Staff