module.exports = function(grunt) {
    var config = require('./.screeps.json');

    var branch = grunt.option('branch') || config.branch;
    var email = grunt.option('email') || config.email;
    var password = grunt.option('password') || config.password;
    var ptr = grunt.option('ptr') ? true : config.ptr;
    var private_directory = grunt.option('private_directory') || config.private_directory;

    grunt.loadNpmTasks('grunt-screeps');
    grunt.loadNpmTasks('grunt-rsync');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-copy');

    grunt.initConfig({
        screeps: {
            options: {
                email: email,
                password: password,
                branch: branch,
                ptr: ptr
            },
            dist: {
                src: ['src/*.js']
            }
        },
        rsync: {
            options: {
                args: ["--verbose", "--checksum"],
                exclude: [".git*"],
                recursive: true
            },
            private: {
                options: {
                    src: './dist/*.js',
                    dest: private_directory,
                }
            },
        },
        // Remove all files from the dist folder.
        clean: {
            'dist': ['dist']
        },
  
        // Copy all source files into the dist folder, flattening the folder structure by converting path delimiters to underscores
        copy: {
            // Pushes the game code to the dist folder so it can be modified before being send to the screeps server.
            screeps: {
                files: [{
                    expand: true,
                    cwd: 'src/',
                    src: '**',
                    dest: 'dist/',
                    filter: 'isFile',
                    rename: function (dest, src) {
                        // Change the path name utilize underscores for folders
                        return dest + src.replace(/\//g,'_');
                    }
                }],
            }
          },
    });

    grunt.registerTask('default',  ['clean', 'copy:screeps', 'screeps']);
    grunt.registerTask('private',  ['clean', 'copy:screeps', 'rsync:private']);
}
@@ -818,19 +818,20 @@
  src: %5B'
-src
+dist
 /*.js'%5D%0A
@@ -1315,18 +1315,16 @@
      %7D,%0A
-  
 %0A       
@@ -2228,8 +2228,9 @@
 te'%5D);%0A%7D
+%0A

fix Gruntfile so it will now push all js file from dist instead of old src