JSDOC/Packer.js
[gnome.introspection-doc-generator] / JSDOC / Packer.js
index b7fc9ef..d879cbf 100644 (file)
@@ -10,6 +10,7 @@ CompressWhite   = imports.CompressWhite.CompressWhite;
 Collapse        = imports.Collapse.Collapse;
 
 GLib = imports.gi.GLib;
+Gio = imports.gi.Gio;
 /**
  * @namespace JSDOC
  * @class  Packer
@@ -83,15 +84,16 @@ Packer = function(cfg)
         throw "No Files";
     }
     
+    var link = false;
     if (cfg.autoBuild) {
         var version = 0;
         this.files.forEach(function(f) {
-            print(f);
             version = Math.max(File.mtime(f), version);
         });
         var dirname = GLib.path_get_dirname(this.files[0]);
         var outname = this.module ? this.module : GLib.path_get_basename(dirname);
         this.target = dirname + '/compiled/' + outname + '-' + version + '.js';
+        link = dirname + '/compiled/' + outname + '.js';
         if (File.exists(this.target)) {
             print("Target file already exists");
             Seed.quit();
@@ -100,13 +102,20 @@ Packer = function(cfg)
         this.translateJSON  = dirname + '/compiled/_translation_.js';
         
     }
-    
-    print(this);
-    Seed.quit();
+     
     
     this.timer =  new Date() * 1;
     this.packAll();
     
+    if (link) {
+        if (File.exists(link)) {
+            File.remove(link);
+        }
+        var f = Gio.file_new_for_path(this.target);
+        f.make_symbolic_link(link);
+    }
+    
+    
  
 }
 Packer.prototype = {