| import os |
| from flask import Flask, send_from_directory, abort |
|
|
| |
| def clone_repo(): |
| |
| clone_flag = "repo_cloned.flag" |
| |
| if not os.path.exists(clone_flag): |
| print("Cloning the repository...") |
| result = os.system("git clone https://github.com/ozh/cookieclicker.git .") |
| if result != 0: |
| print("Error: Failed to clone the repository.") |
| else: |
| |
| with open(clone_flag, 'w') as f: |
| f.write("Repository has been cloned.") |
| else: |
| print("Repository already cloned.") |
|
|
| |
| clone_repo() |
|
|
| |
| app = Flask(__name__) |
|
|
| |
| @app.route('/') |
| def index(): |
| |
| if not os.path.exists("index.html"): |
| return abort(404, description="index.html not found.") |
| return send_from_directory('.', 'index.html') |
|
|
| if __name__ == '__main__': |
| |
| app.run(host='0.0.0.0', port=7860) |
|
|