var Fs = require('fs');
var Async = require('async');
var Utils = require('../utils/utils.js');

(function() {
    'use strict';
    var pluginManager = {};
    var root = this;
    var PLUGINDIR = process.env.HOME + '/.friday/plugins';
    //var PLUGINDIR = process.env.HOME ;

    pluginManager.upgrade = function() {};

    pluginManager.load = function(callback) {
        Async.waterfall([
            Async.apply(Utils.mkdirfp, PLUGINDIR),
            Async.apply(Fs.readdir, PLUGINDIR),
            Async.asyncify(console.log)
            ],callback);
    };

    pluginManager.validate = function() {};

    // Node.js
    if (typeof module !== 'undefined' && module.exports) {
        module.exports = pluginManager;
    }
    // AMD / RequireJS
    else if (typeof define !== 'undefined' && define.amd) {
        define([], function() {
            return pluginManager;
        });
    }
    // included directly via <script> tag
    else {
        root.pluginManager = pluginManager;
    }

}());

@@ -13,24 +13,52 @@
 uire('fs');%0A
+var Path = require('path');%0A
 var Async = 
@@ -211,32 +211,42 @@
 var PLUGINDIR = 
+Path.join(
 process.env.HOME
@@ -250,28 +250,28 @@
 OME 
-+ '/
+,'
 .friday
-/
+','
 plugins'
 ;%0A  
@@ -270,49 +270,9 @@
 ins'
-;%0A    //var PLUGINDIR = process.env.HOME 
+)
 ;%0A%0A 

use path for plugin loader