Final User interface tweaks to basic commit code (shows dialogs while it does stuff)
[gitlive] / gen.php
1 <?php
2
3 // A script to create komodo projects for all git repos.. need to work out how to do it for
4 // remote list..
5
6
7 $ar = explode("\n", 
8  
9 ");
10
11
12
13
14 $dir = '/home/alan/gitlive';
15 foreach($ar as $a) {
16         $a = trim($a);
17         if (!file_exists($dir.'/'. $a)) {
18
19                 $cmd = 'git clone http://git.roojs.com:8081/'. $a;
20 echo $cmd ."\n";
21                 `$cmd`;
22         }
23         if (file_exists($dir. '/'. $a.'.komodoproject')) {
24                 continue;
25         }
26         $m = md5(rand());
27         $mm = array();
28         $b = array(8,4,4,4,12);
29         $bl = 0;
30         foreach($b as $bb) {
31                 $mm[] = substr($m, $bl,$bb);
32                 $bl+=$bb;
33         }
34         $mm = implode('-', $mm);
35
36 file_put_contents($dir. '/'. $a.'.komodoproject',
37 '<?xml version="1.0" encoding="UTF-8"?>
38 <!-- Komodo Project File - DO NOT EDIT -->
39 <project id="'.$mm.'" kpf_version="5" name="'.$a.'.komodoproject">
40 <preference-set idref="'.$mm.'">
41   <string relative="path" id="import_dirname">'.$a.'</string>
42   <string id="import_exclude_matches">*.*~;*.bak;*.tmp;CVS;.#*;*.pyo;*.pyc;.svn;.git;.hg;.bzr;*%*;tmp*.html;.DS_Store;*.swp;*.kpf;*.komodoproject;*.komodoto
43 ols</string>
44   <string id="import_include_matches"></string>
45   <string relative="path" id="last_local_directory">'.$a.'</string>
46 </preference-set>
47 </project>');
48  
49 }
50