Clone.bjs
authorAlan Knowles <alan@roojs.com>
Fri, 14 Dec 2018 07:45:45 +0000 (15:45 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 14 Dec 2018 07:45:45 +0000 (15:45 +0800)
Clone.vala

Clone.bjs
Clone.vala

index ce9d426..c0ee56f 100644 (file)
--- a/Clone.bjs
+++ b/Clone.bjs
@@ -53,7 +53,7 @@
       },
       {
        "listeners" : {
-        "button_press_event" : "() => {\n     \n     var repo = _this.reposel.selectedRepo();\n        GitMonitor.gitmonitor.stop();\n        \n    \n        string[]  args = { \"git\" , \"--no-pager\" , \"clone\" };\n    \n        args +=  (\"http://git.roojs.com/\" + repo );\n \n  \n        for (var i = 0; i < args_in.length;i++) {\n            args += args_in[i];\n        }            \n\n        //this.lastCmd = args.join(\" \");\n        //if(this.debug) {\n            GLib.debug( \"CWD=%s\",  this.git_working_dir ); \n            GLib.debug( \"cmd: %s\", string.joinv (\" \", args)); \n        //}\n\n        string[]   env = {};\n        string  home = \"HOME=\" + Environment.get_home_dir() ;\n        env +=  home ;\n        // do not need to set gitpath..\n        //if (File.exists(this.repo + '/.git/config')) {\n            //env.push(\"GITPATH=\" + this.repo );\n        //}\n          \n        var cfg = new SpawnConfig(this.git_working_dir , args , env);\n        //cfg.debug = true;\n\n       // may throw error...\n        var sp = new Spawn(cfg);\n      \n      \t// diff output is a bit big..\n\t\tif (args_in[0] != \"diff\") {\n\t        GLib.debug( \"GOT: %s\" , sp.output);\n        }\n        // parse output for some commands ?\n        return sp.output;\n    }\n\t\n        \n        \n        \n        \n        \n        GitMonitor.gitmonitor.start();\n     \n     \n       _this.el.hide();\n        return false;\n}"
+        "button_press_event" : "() => {\n     \n     var repo = _this.reposel.selectedRepo();\n        GitMonitor.gitmonitor.stop();\n        \n    \n        string[]  args = { \"git\" , \"--no-pager\" , \"clone\" };\n    \n        args +=  (\"http://git.roojs.com/\" + repo );\n \n    \n\n        string[]   env = {};\n        string  home = \"HOME=\" + Environment.get_home_dir() ;\n        env +=  home ;\n   \t\t//v.push(\"GITPATH=\" + this.repo );\n        //}\n          \n        var cfg = new SpawnConfig(Environment.get_home_dir() + \"/gitlive\" , args , env);\n        //cfg.debug = true;\n\n       // may throw error...\n        var sp = new Spawn(cfg);\n      \n      \t\n        // parse output for some commands ?\n        return sp.output;\n    }\n\t\n        \n        \n        \n        \n        \n        GitMonitor.gitmonitor.start();\n     \n     \n       _this.el.hide();\n        return false;\n}"
        },
        "label" : "Checkout",
        "xtype" : "Button",
index e463bc7..13ab584 100644 (file)
@@ -246,35 +246,21 @@ public class Clone : Object
                 
                     args +=  ("http://git.roojs.com/" + repo );
              
-              
-                    for (var i = 0; i < args_in.length;i++) {
-                        args += args_in[i];
-                    }            
-            
-                    //this.lastCmd = args.join(" ");
-                    //if(this.debug) {
-                        GLib.debug( "CWD=%s",  this.git_working_dir ); 
-                        GLib.debug( "cmd: %s", string.joinv (" ", args)); 
-                    //}
+                
             
                     string[]   env = {};
                     string  home = "HOME=" + Environment.get_home_dir() ;
                     env +=  home ;
-                    // do not need to set gitpath..
-                    //if (File.exists(this.repo + '/.git/config')) {
-                        //env.push("GITPATH=" + this.repo );
+                               //v.push("GITPATH=" + this.repo );
                     //}
                       
-                    var cfg = new SpawnConfig(this.git_working_dir , args , env);
+                    var cfg = new SpawnConfig(Environment.get_home_dir() + "/gitlive" , args , env);
                     //cfg.debug = true;
             
                    // may throw error...
                     var sp = new Spawn(cfg);
                   
-                       // diff output is a bit big..
-                       if (args_in[0] != "diff") {
-                       GLib.debug( "GOT: %s" , sp.output);
-                    }
+                       
                     // parse output for some commands ?
                     return sp.output;
                 }