var fs = require('fs'),
    fse = require('fs-extra'),
    wrench = require('wrench'),
    colors = require('colors'),
    helpers = require('./helpers');

var config = {
    forceDelete: false,
    preserveFiles: true
};

module.exports = function (corePath) {

    try {

        var path = helpers.getPath(corePath);

        fse.copy(path.core('/weltmeister.html'), path.current('/weltmeister.html'), helpers.errorHandler);

        fs.readFile(path.core('/index.html'), 'utf8', function (err, data) {

            helpers.errorHandler(err);

            data = data.replace(
                /<canvas id="canvas"><\/canvas>/g,
                '<a href="/editor" target="blank_" class="btn">Editor</a><canvas id="canvas"></canvas>'
            );

            data = data.split('</style>')
                .join('.btn{display:block;position:absolute;padding:6px 10px;color:#1F1F1F;text-decoration:none;background:#666;border-radius:4px;border:1px solid #303030;box-shadow:inset 0 1px #888,0 1px 2px #222;top:0;left:0;margin:10px}</style>');

            fs.writeFile(path.current('/index.html'), data, helpers.errorHandler);
        });

        fse.mkdirs(path.current('/src'), helpers.errorHandler);
        fse.mkdirs(path.current('/src/lib'), helpers.errorHandler);

        wrench.copyDirSyncRecursive(path.core('/lib/weltmeister'), path.current('/src/lib/weltmeister'), config);

        wrench.copyDirSyncRecursive(path.core('/lib/game'), path.current('/src/lib/game'), config);
        wrench.copyDirSyncRecursive(path.core('/lib/impact'), path.current('/src/lib/impact'), config);

        fs.readFile(path.current('/src/lib/weltmeister/config.js'), 'utf8', function (err, data) {

            helpers.errorHandler(err);

            data = data.replace(/lib\/weltmeister\/api\/save.php/g, '/api/save');
            data = data.replace(/lib\/weltmeister\/api\/browse.php/g, '/api/browse');
            data = data.replace(/lib\/weltmeister\/api\/glob.php/g, '/api/glob');

            fs.writeFile(path.current('/src/lib/weltmeister/config.js'), data, helpers.errorHandler);
        });

        wrench.copyDirSyncRecursive(path.core('/media'), path.current('/src/media'), config);

        console.log('Done! Run '.green + 'impact-node serve '.yellow + 'to start development server'.green);

    } catch (error) {

        throw error;
    }
};

@@ -874,14 +874,14 @@
 or:#
-1F1F1F
+242424
 ;tex
@@ -914,11 +914,14 @@
 nd:#
-666
+fafafa
 ;bor
@@ -935,79 +935,11 @@
 ius:
-4px;border:1px solid #303030;box-shadow:inset 0 1px #888,0 1px 2px #222
+2px
 ;top
@@ -959,16 +959,33 @@
 gin:10px
+;line-height:1em;
 %7D%3C/style

Change Editor button styles