var path = require('path'),
	logger = require('../../common/logger'),
	U = require('../../utils'),
	alloyRoot = path.join(__dirname,'..','..','..'); 

// TODO: these should be broken out into individual modules, like in generate
var TARGETS = ['plugin'];

module.exports = function(args, program) {
	var target = args[0] || U.die([
		'`alloy install` must have a target',
		'usage: alloy install plugin PROJECT_PATH'
	]);
	var paths = U.getAndValidateProjectPaths(args[1] || '.');

	switch(target) {
		case 'plugin':
			U.installPlugin(alloyRoot, paths.project);
			logger.info('Alloy plugins and hooks installed in project at "' + paths.project + '"');
			break;
		default:
			U.die([
				'Invalid target "' + target + '" for `alloy install`',
				'Must be one of the following: [' + TARGETS.join(',') + ']'
			]);
			break;
	}
}

@@ -92,16 +92,60 @@
 tils'),%0A
+%09CONST = require('../../common/constants'),%0A
 %09alloyRo
@@ -192,167 +192,147 @@
 ; %0A%0A
-// TODO: these should be broken out into individual modules, like in generate%0Avar TARGETS = %5B'plugin'%5D;%0A%0Amodule.exports = function(args, program) %7B%0A%09var target
+module.exports = function(args, program) %7B%0A%09var errMsg = 'Must be one of the following: %5B' + CONST.INSTALL_TYPES.join(',') + '%5D';%0A%09var type
  = a
@@ -348,19 +348,16 @@
  U.die(%5B
-%0A%09%09
 '%60alloy 
@@ -382,66 +382,60 @@
  a t
-arget',%0A%09%09'usage: alloy install plugin PROJECT_PATH'%0A%09%5D);%0A
+ype', errMsg%5D);%0A%0A%09switch(type) %7B%0A%09%09case 'plugin':%0A%09%09
 %09var
@@ -492,44 +492,8 @@
 .');
-%0A%0A%09switch(target) %7B%0A%09%09case 'plugin':
 %0A%09%09%09
@@ -657,21 +657,16 @@
 %09U.die(%5B
-%0A%09%09%09%09
 'Invalid
@@ -670,26 +670,30 @@
 lid 
-target
+install type
  %22' + t
-arget
+ype
  + '
@@ -719,76 +719,15 @@
 l%60',
-%0A%09%09%09%09'Must be one of the following: %5B' + TARGETS.join(',') + '%5D'%0A%09%09%09
+ errMsg
 %5D);%0A

use constants and some cleanup in install command