Skip to content
This repository was archived by the owner on Jan 24, 2021. It is now read-only.

Commit 8ae786f

Browse files
committed
fix $PATH issues on OS X - no longer need to hardcode bin
1 parent 93e80d2 commit 8ae786f

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

app/get-gulp-tasks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var gulpPath = path.join(__dirname, 'node_modules', 'gulp', 'bin', 'gulp.js');
77
var re = /] (?:|)[^\w]+(\w+)/g;
88

99
module.exports = function (cb) {
10-
execFile('/usr/local/bin/node', [gulpPath, '--tasks', '--no-color'], function (err, stdout) {
10+
execFile(gulpPath, ['--tasks', '--no-color'], function (err, stdout) {
1111
if (err) {
1212
return cb(err);
1313
}

app/main.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,18 @@ var getGulpTasks = require('./get-gulp-tasks');
1111
var DEBUG = true;
1212
var TRAY_UPDATE_INTERVAL = 1000;
1313

14+
// fix the $PATH on OS X
15+
// OS X doesn't read .bashrc/.zshrc for GUI apps
16+
if (process.platform === 'darwin') {
17+
process.env.PATH = process.env.PATH + ':/usr/local/bin';
18+
}
19+
1420
function runTask(taskName) {
1521
// TODO: find workaround for node-webkit bug:
1622
// https://github.com/rogerwang/node-webkit/issues/213
1723
// so I don't have to hardcode the node path
1824
var gulpPath = path.join(util.dirname, 'node_modules', 'gulp', 'bin', 'gulp.js');
19-
var cp = spawn('/usr/local/bin/node', [gulpPath, taskName, '--no-color']);
25+
var cp = spawn(gulpPath, [taskName, '--no-color']);
2026

2127
cp.stdout.setEncoding('utf8');
2228
cp.stdout.on('data', function (data) {

app/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "gulp-app",
3-
"version": "0.0.0",
43
"description": "gulp as an app (OS X)",
54
"license": "MIT",
65
"repository": "sindresorhus/gulp-app",

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Easily run gulp tasks from the current directory in Finder and get notified when
1313

1414
[Download](https://github.com/sindresorhus/gulp-app/releases) the app, unzip, and move it to the `Applications` folder.
1515

16-
*Make sure your node binary is in `/usr/local/bin` by running `$ which node`. It's [currently hard-coded](https://github.com/sindresorhus/gulp-app/blob/1b7fd477653f5b23b999a0e89667f9a281a41797/app/main.js#L19-L22) because of a node-webkit [bug](https://github.com/rogerwang/node-webkit/issues/213). Devtools is opened with the app to make it easier to debug issues. Feel free to close it.*
16+
*Devtools is opened with the app to make it easier to debug issues. Feel free to close it.*
1717

1818
Feedback wanted :)
1919

0 commit comments

Comments
 (0)