26 lines
645 B
Python
26 lines
645 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 yourproject && npm install',
|
|
'npm run build'
|
|
]
|
|
|
|
# Run each command in sequence
|
|
for cmd in commands:
|
|
print(f"Executing: {cmd}")
|
|
run_command(cmd)
|
|
|
|
if __name__ == '__main__':
|
|
main() |