Kenneth Jørgensen avatar Kenneth Jørgensen committed b97d22a

Fixed jessie binary path resolution

Comments (0)

Files changed (4)

 # Changelog
 
-## 0.0.1 (dev)
+## 0.0.2 (2013-07-23)
+* Fixed Jessie binary path resolution.
+
+## 0.0.1 (2013-07-23)
 * Initial version.
 {
 	"fullname": "Jessie Grunt task",
 	"name": "grunt-jessie",
-	"version": "0.0.1",
+	"version": "0.0.2",
 	"description": "Grunt task for running Jasmine tests via Jessie.",
 	"keywords": ["jasmine", "jessie", "grunt", "gruntplugin"],
 	"homepage": "https://bitbucket.org/kennethjor/grunt-jessie",

src/jessie.coffee

-exec = require("child_process").exec
 spawn = require("child_process").spawn
+path = require "path"
 
-JESSIE_BIN = "#{__dirname}/../node_modules/jessie/bin/jessie"
+# Meh.
+JESSIE_BIN = require.resolve("jessie") + "../../../bin/jessie"
+JESSIE_BIN = path.normalize JESSIE_BIN
 
 # Jessie task.
 module.exports = (grunt) ->
 (function() {
-  var JESSIE_BIN, exec, spawn;
-
-  exec = require("child_process").exec;
+  var JESSIE_BIN, path, spawn;
 
   spawn = require("child_process").spawn;
 
-  JESSIE_BIN = "" + __dirname + "/../node_modules/jessie/bin/jessie";
+  path = require("path");
+
+  JESSIE_BIN = require.resolve("jessie") + "../../../bin/jessie";
+
+  JESSIE_BIN = path.normalize(JESSIE_BIN);
+
+  console.log(JESSIE_BIN);
 
   module.exports = function(grunt) {
     return grunt.registerMultiTask("jessie", "Runs Jasmine specs with Jessie", function() {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.