#!/usr/bin/env node

var ncp = require('ncp').ncp;
var path = require('path');

require('yargs')
    .usage('$0 <cmd> [args]')
    .option('directory', {
        alias: 'd',
        describe: 'Provide the directory to install Violet to'
    })
    .command('install', 'Install violet', {}, function (argv) {
        var directory = 'violet';
        if (argv.directory != null) {
            directory = argv.directory;
        }

        ncp(path.resolve(__dirname, './source'), directory, function (err) {
            if (err) {
                return console.error(err);
            }
            console.log('Installed Violet!');
        });
    })
    .help('help')
    .argv;

@@ -71,16 +71,40 @@
 'path');
+%0Avar fs = require('fs');
 %0A%0Arequir
@@ -294,17 +294,17 @@
 Install 
-v
+V
 iolet', 
@@ -448,24 +448,377 @@
      %7D%0A%0A    
+    install(directory);%0A    %7D)%0A    .command('update', 'Update Violet', %7B%7D, function (argv) %7B%0A        var directory = 'violet';%0A        if (argv.directory != null) %7B%0A            directory = argv.directory;%0A        %7D%0A%0A        deleteFolderRecursive(directory);%0A        install(directory);%0A    %7D)%0A    .help('help')%0A    .argv;%0A%0Afunction install(directory) %7B%0A
     ncp(path
@@ -882,28 +882,24 @@
 ) %7B%0A        
-    
 if (err) %7B%0A 
@@ -893,28 +893,24 @@
  if (err) %7B%0A
-    
             
@@ -936,20 +936,16 @@
 r(err);%0A
-    
         
@@ -954,20 +954,16 @@
         
-    
 console.
@@ -996,48 +996,524 @@
     
-    %7D);%0A    %7D)%0A    .help('help')%0A    .argv
+%7D);%0A%7D%0A%0A// thanks to http://www.geedew.com/remove-a-directory-that-is-not-empty-in-nodejs/%0Afunction deleteFolderRecursive(path) %7B%0A    if (fs.existsSync(path)) %7B%0A        fs.readdirSync(path).forEach(function (file, index) %7B%0A            var curPath = path + %22/%22 + file;%0A            if (fs.lstatSync(curPath).isDirectory()) %7B // recurse%0A                deleteFolderRecursive(curPath);%0A            %7D else %7B // delete file%0A                fs.unlinkSync(curPath);%0A            %7D%0A        %7D);%0A        fs.rmdirSync(path);%0A    %7D%0A%7D
 ;%0A

Add update fucntion to CLI