Skip to content

Linux: Failed to open path with a space in the name of a folder #44

Open

Description

@demipel8

Trying to execute open from grunt I got the next warning:

Warning: Command failed: /bin/sh -c /run/media/lol/New Folder/node_modules/open/vendor/xdg-open "http://localhost:9000"
/bin/sh: /run/media/lol/New: No such file or directory

I've fixed it adding a function to escape the space, don't know if it's the best solution:

opener = space(path.join(__dirname, '../vendor/xdg-open'));
function space(s) {
    return s.replace(/ /g, '\\\ ');
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions