zzyxyz_server/start.py

33 lines
798 B
Python

import subprocess
def run_command(command):
"""Run a shell command."""
try:
subprocess.run(command, check=True, shell=True)
except subprocess.CalledProcessError as e:
print(f"Error executing command: {command}")
print(e)
exit(1)
def main():
# Define the commands you want to run
commands = [
# 'git clone https://github.com/yourusername/yourproject.git',
'cd vue-project',
'git pull',
'npm install',
'npm run build',
'cd ..',
'git pull',
'npm install',
'cp -r vue-project/dist/* ./dist'
'npm start'
]
# Run each command in sequence
for cmd in commands:
print(f"Executing: {cmd}")
run_command(cmd)
if __name__ == '__main__':
main()