mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-12 13:42:59 +00:00
change default user to be programatic to download git updates
This commit is contained in:
@@ -2,6 +2,7 @@ from flask import Flask, render_template, request, redirect, url_for, flash, jso
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from pathlib import Path
|
||||||
from src.config_manager import ConfigManager
|
from src.config_manager import ConfigManager
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
@@ -267,8 +268,10 @@ def run_action_route():
|
|||||||
result = subprocess.run(['sudo', 'reboot'],
|
result = subprocess.run(['sudo', 'reboot'],
|
||||||
capture_output=True, text=True)
|
capture_output=True, text=True)
|
||||||
elif action == 'git_pull':
|
elif action == 'git_pull':
|
||||||
|
home_dir = str(Path.home())
|
||||||
|
project_dir = os.path.join(home_dir, 'LEDMatrix')
|
||||||
result = subprocess.run(['git', 'pull'],
|
result = subprocess.run(['git', 'pull'],
|
||||||
capture_output=True, text=True, cwd='/home/pi/LEDMatrix')
|
capture_output=True, text=True, cwd=project_dir, check=True)
|
||||||
else:
|
else:
|
||||||
return jsonify({
|
return jsonify({
|
||||||
'status': 'error',
|
'status': 'error',
|
||||||
|
|||||||
Reference in New Issue
Block a user