JSDOC/Packer.js
authorAlan Knowles <alan@akbkhome.com>
Tue, 27 Jul 2010 06:38:38 +0000 (14:38 +0800)
committerAlan Knowles <alan@akbkhome.com>
Tue, 27 Jul 2010 06:38:38 +0000 (14:38 +0800)
JSDOC/Packer.js

index 1f5525b..c210e10 100644 (file)
@@ -93,9 +93,7 @@ Packer = function(cfg)
         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';
-        linkTarget = './' + GLib.path_get_basename(this.target);
-        if (File.exists(this.target)) {
+         if (File.exists(this.target)) {
             print("Target file already exists");
             Seed.quit();
         }
@@ -108,13 +106,6 @@ Packer = function(cfg)
     this.timer =  new Date() * 1;
     this.packAll();
     
-    if (link) {
-        if (File.exists(link)) {
-            File.remove(link);
-        }
-        var f = Gio.file_new_for_path(link);
-        f.make_symbolic_link(linkTarget);
-    }
     
     
  
@@ -159,6 +150,12 @@ Packer.prototype = {
      *    Defaults to false if you set tmpDir, otherwise true.
      */
     cleanup : true,  
+    /**
+     * @cfg {Boolean} cleanup  (optional) clean up temp files after done - 
+     *    Defaults to false if you set tmpDir, otherwise true.
+     */
+    
+    keepWhite: true,
     
     /**
      * @cfg {String} prefix (optional) prefix of directory to be stripped of when
@@ -397,8 +394,8 @@ Packer.prototype = {
         print(sp.warnings.join("\n"));
         
         
-        //var out = CompressWhite(new TokenStream(toks), this, true); // do not kill whitespace..
-        var out = CompressWhite(new TokenStream(toks), this, false);
+        var out = CompressWhite(new TokenStream(toks), this, this.keepWhite); // do not kill whitespace..
+        
         this.timerPrint("Compressed");
         return out;