comparison python/install_config.py @ 6:524f9e7fa224

be backwards compatible
author k0s <k0scist@gmail.com>
date Wed, 09 Dec 2009 13:05:28 -0500
parents f58e8e81e16b
children c38d875a3b78
comparison
equal deleted inserted replaced
5:81619b59dd51 6:524f9e7fa224
5 curl http://k0s.org/hg/config/python/install-config.py | python 5 curl http://k0s.org/hg/config/python/install-config.py | python
6 """ 6 """
7 7
8 SRC='http://k0s.org/hg/config' 8 SRC='http://k0s.org/hg/config'
9 import os 9 import os
10 import sys
10 os.chdir(os.environ['HOME']) 11 os.chdir(os.environ['HOME'])
11 12
12 # make the current directory a repository 13 # make the current directory a repository
13 import subprocess 14 import subprocess
14 subprocess.check_call(['hg', 'init']) 15
15 subprocess.check_call(['hg', 'pull', SRC]) 16 commands = [ ['hg', 'init'],
16 subprocess.check_call(['hg', 'update', '-C']) 17 ['hg', 'pull', SRC],
18 ['hg', 'update', '-C' ] ]
19
20 for command in commands:
21 code = subprocess.call(command)
22 if code:
23 sys.exit(code)
17 24
18 25
26