"use strict";

const
    IO_PATH = "../ArnaudBuchholz.github.io/",
    fs = require("fs"),
    copy = {
        publishVersionPlato: {},
        publishVersion: {},
        publishVersionDoc: {},
        publishTest: {},
        publishTestRequire: {},
        publishTestData: {},
        instrumentSourcesJson: {
            expand: true,
            cwd: "./src/",
            src: "**/*.json",
            dest: "./tmp/coverage/instrument/src/"
        }
    };

if (fs.existsSync(IO_PATH)) {
    Object.assign(copy, {
        publishVersionPlato: {
            expand: true,
            cwd: "./tmp/plato/",
            src: "**/*.*",
            dest: IO_PATH + "gpf/plato/"
        },
        publishVersion: {
            expand: true,
            cwd: "./build/",
            src: ["gpf.js", "gpf-debug.js", "tests.js"],
            dest: IO_PATH + "gpf/" + configuration.pkg.version + "/"
        },
        publishVersionDoc: {
            expand: true,
            cwd: "./tmp/doc/public",
            src: "**/*.*",
            dest: IO_PATH + "gpf/doc/"
        },
        publishTest: {
            expand: true,
            cwd: "./test/host/",
            src: ["test.html", "bdd.js"],
            dest: IO_PATH + "gpf/"
        },
        publishTestRequire: {
            expand: true,
            cwd: "./test/require/",
            src: "**/*.*",
            dest: IO_PATH + "gpf/test-resources/require"
        },
        publishTestData: {
            expand: true,
            cwd: "./test/data/",
            src: "**/*.*",
            dest: IO_PATH + "gpf/test-resources/data"
        }
    });
}

module.exports = copy;

@@ -17,15 +17,16 @@
 onst
-%0A    IO
+ PUBLISH
 _PAT
@@ -34,10 +34,11 @@
  = %22
-..
+tmp
 /Arn
@@ -64,470 +64,30 @@
 io/%22
-,%0A    fs = require(%22fs%22),%0A    copy = %7B%0A        publishVersionPlato: %7B%7D,%0A        publishVersion: %7B%7D,%0A        publishVersionDoc: %7B%7D,%0A        publishTest: %7B%7D,%0A        publishTestRequire: %7B%7D,%0A        publishTestData: %7B%7D,%0A        instrumentSourcesJson: %7B%0A            expand: true,%0A            cwd: %22./src/%22,%0A            src: %22**/*.json%22,%0A            dest: %22./tmp/coverage/instrument/src/%22%0A        %7D%0A    %7D;%0A%0Aif (fs.existsSync(IO_PATH)) %7B%0A    Object.assign(copy, %7B%0A    
+;%0A%0Amodule.exports = %7B%0A
     
@@ -109,36 +109,32 @@
 lato: %7B%0A        
-    
 expand: true,%0A  
@@ -123,36 +123,32 @@
   expand: true,%0A
-    
         cwd: %22./
@@ -160,36 +160,32 @@
 lato/%22,%0A        
-    
 src: %22**/*.*%22,%0A 
@@ -187,36 +187,37 @@
 *%22,%0A        
-    
 dest: 
-IO
+PUBLISH
 _PATH + %22gpf
@@ -225,35 +225,27 @@
 plato/%22%0A    
-   
- 
 %7D,%0A
-    
     publishV
@@ -254,36 +254,32 @@
 sion: %7B%0A        
- 
-   
 expand: true,%0A  
@@ -268,36 +268,32 @@
   expand: true,%0A
-    
         cwd: %22./
@@ -297,28 +297,24 @@
 %22./build/%22,%0A
-    
         src:
@@ -358,36 +358,37 @@
 %22%5D,%0A        
-  
-  
 dest: 
-IO
+PUBLISH
 _PATH + %22gpf
@@ -424,35 +424,27 @@
 n + %22/%22%0A    
-   
- 
 %7D,%0A
-    
     publishV
@@ -456,36 +456,32 @@
 nDoc: %7B%0A        
-    
 expand: true,%0A  
@@ -470,36 +470,32 @@
   expand: true,%0A
-    
         cwd: %22./
@@ -511,36 +511,32 @@
 ublic%22,%0A        
-    
 src: %22**/*.*%22,%0A 
@@ -538,36 +538,37 @@
 *%22,%0A        
-    
 dest: 
-IO
+PUBLISH
 _PATH + %22gpf
@@ -574,31 +574,23 @@
 f/doc/%22%0A
-    
     %7D,%0A
-    
     publ
@@ -600,36 +600,32 @@
 Test: %7B%0A        
-  
-  
 expand: true,%0A  
@@ -614,36 +614,32 @@
   expand: true,%0A
-    
         cwd: %22./
@@ -655,28 +655,24 @@
 /%22,%0A        
-    
 src: %5B%22test.
@@ -693,36 +693,37 @@
 %22%5D,%0A        
-  
-  
 dest: 
-IO
+PUBLISH
 _PATH + %22gpf
@@ -725,35 +725,27 @@
  %22gpf/%22%0A    
-   
- 
 %7D,%0A
-    
     publishT
@@ -758,36 +758,32 @@
 uire: %7B%0A        
-    
 expand: true,%0A  
@@ -780,36 +780,32 @@
 : true,%0A        
-   
- 
 cwd: %22./test/req
@@ -812,36 +812,32 @@
 uire/%22,%0A        
-    
 src: %22**/*.*%22,%0A 
@@ -839,36 +839,37 @@
 *%22,%0A        
-  
-  
 dest: 
-IO
+PUBLISH
 _PATH + %22gpf
@@ -897,27 +897,19 @@
 re%22%0A    
-    %7D,%0A    
+%7D,%0A
     publ
@@ -927,28 +927,24 @@
 : %7B%0A        
- 
-   
 expand: true
@@ -941,28 +941,24 @@
 pand: true,%0A
-    
         cwd:
@@ -978,28 +978,24 @@
 /%22,%0A        
-    
 src: %22**/*.*
@@ -1009,20 +1009,21 @@
     
-  
-  
 dest: 
-IO
+PUBLISH
 _PAT
@@ -1060,44 +1060,163 @@
     
+%7D,%0A
     
-%7D%0A    %7D);%0A%7D%0A%0Amodule.exports = copy
+instrumentSourcesJson: %7B%0A        expand: true,%0A        cwd: %22./src/%22,%0A        src: %22**/*.json%22,%0A        dest: %22./tmp/coverage/instrument/src/%22%0A    %7D%0A%7D
 ;%0A

Simplify publish (#237)