1
|
1 #!/usr/bin/env python
|
|
2 """
|
|
3 installs config to a user's home directory
|
|
4 this can be done with
|
7
|
5 curl http://k0s.org/hg/config/raw/tip/python/install_config.py | python
|
1
|
6 """
|
|
7
|
|
8 SRC='http://k0s.org/hg/config'
|
|
9 import os
|
6
|
10 import sys
|
1
|
11 os.chdir(os.environ['HOME'])
|
|
12
|
|
13 # make the current directory a repository
|
|
14 import subprocess
|
6
|
15
|
|
16 commands = [ ['hg', 'init'],
|
|
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)
|
1
|
24
|
|
25
|
6
|
26
|