Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

begin target behaviour

  • Loading branch information...
commit f8b6e53f9bc85aa957933d5d99b9c4d221d2fa13 1 parent bf3b558
@popeindustries authored
Showing with 16 additions and 2 deletions.
  1. +10 −1 lib/target.js
  2. +5 −0 src/target.coffee
  3. +1 −1  test/target-test.coffee
View
11 lib/target.js
@@ -1,6 +1,12 @@
-var CSSTarget, JSTarget, Target, log;
+var CSSTarget, JSTarget, Target, fs, log, path, term;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
+fs = require('fs');
+
+path = require('path');
+
+term = require('./terminal');
+
log = console.log;
exports.Target = Target = (function() {
@@ -8,6 +14,9 @@ exports.Target = Target = (function() {
function Target(input, output) {
this.input = input;
this.output = output;
+ if (fs.statSync(this.input).isDirectory() && fs.statSync(this.output).isFile()) {
+ term.out("" + (term.colour('warning', term.RED)) + " ", 2);
+ }
}
Target.prototype._parseInputs = function(input) {};
View
5 src/target.coffee
@@ -1,7 +1,12 @@
+fs = require 'fs'
+path = require 'path'
+term = require './terminal'
{log} = console
exports.Target = class Target
constructor: (@input, @output) ->
+ if fs.statSync(@input).isDirectory() and fs.statSync(@output).isFile()
+ term.out "#{term.colour('warning', term.RED)} ", 2
_parseInputs: (input) ->
View
2  test/target-test.coffee
@@ -6,5 +6,5 @@ term = require '../lib/terminal'
file = require '../lib/file'
target = require '../lib/target'
-term.silent = true
+# term.silent = true
Please sign in to comment.
Something went wrong with that request. Please try again.