Skip to content

Commit

Permalink
Merge pull request #342 from JeroenOnstuimig/patch-1
Browse files Browse the repository at this point in the history
Fix named pipe in WSL
  • Loading branch information
mikaelbr authored Oct 22, 2020
2 parents 3006e5a + 8c0355c commit 1c9d956
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion notifiers/toaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var fallback;

const PIPE_NAME = 'notifierPipe';
const PIPE_PATH_PREFIX = '\\\\.\\pipe\\';
const PIPE_PATH_PREFIX_WSL = '/tmp/';

module.exports = WindowsToaster;

Expand Down Expand Up @@ -46,7 +47,8 @@ function parseResult(data) {
}

function getPipeName() {
return `${PIPE_PATH_PREFIX}${PIPE_NAME}-${uuid()}`;
var pathPrefix = utils.isWSL() ? PIPE_PATH_PREFIX_WSL : PIPE_PATH_PREFIX;
return `${pathPrefix}${PIPE_NAME}-${uuid()}`;
}

function notifyRaw(options, callback) {
Expand Down

0 comments on commit 1c9d956

Please sign in to comment.