File size: 1,051 Bytes
14589fa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import os
import sys
import subprocess

# Force UTF-8 output for Windows terminals
sys.stdout.reconfigure(encoding='utf-8')

readme_content = """---
title: MerchFlow AI
emoji: πŸš€
colorFrom: blue
colorTo: indigo
sdk: docker
pinned: false
---
# MerchFlow AI
An AI-powered merchandising agent.
"""

def run_command(command):
    print(f"Running: {command}")
    try:
        subprocess.run(command, check=True, shell=True)
        print("βœ… Success")
    except subprocess.CalledProcessError as e:
        print(f"❌ Error: {e}")
        # Don't exit, try to continue or let user see error

def fix_readme():
    print("Writing README.md...")
    with open("README.md", "w", encoding="utf-8") as f:
        f.write(readme_content)
    print("βœ… Created README.md")

    print("Deploying changes...")
    run_command("git add README.md")
    run_command('git commit -m "Add Hugging Face configuration"')
    run_command("git push space clean_deploy:main")
    print("βœ… Configuration fixed and pushed!")

if __name__ == "__main__":
    fix_readme()