Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/devbot/command.py
blob: 8da80518171590a960e822ee691ae3672aca08dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import subprocess

def run_command(args, test=False):
    print " ".join(args)
    if not test:
        subprocess.check_call(args)

def run_with_sudo(args, test=False):
    args_with_sudo = ["sudo"]
    args_with_sudo.extend(args)

    run_command(args_with_sudo, test=test)