3
from bits import GIT_HOST, PLUGINS, VERSIONS
13
directory = tempfile.mkdtemp()
15
for plugin in PLUGINS:
16
subprocess.call(['git', 'clone', '-q',
17
os.path.join(GIT_HOST,plugin)])
21
def extract_docs(directory):
22
# we just support the latest
23
version = VERSIONS[-1]
24
dest_dir = os.path.join('docs/en', version, 'cordova/plugins')
25
for plugin in PLUGINS:
26
plugindir = os.path.join(directory, plugin)
27
doc_dirs = filter(lambda a: os.path.isdir(a),
28
glob.glob(plugindir+"/doc*"))
30
print "No documentation found for plugin '%s'." % plugin
33
new_path = os.path.join(dest_dir, plugin)
34
subprocess.call(['cp', '-r', doc_dir, new_path])
35
subprocess.call(['bzr', 'add', '-q', new_path])
39
directory = sys.argv[1]
41
directory = clone_code()
42
extract_docs(directory)
45
if __name__ == '__main__':
48
except KeyboardInterrupt:
49
print >> sys.stderr, 'Aborted.'