Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default command in interactive_open #1793

Merged
merged 3 commits into from Jan 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 8 additions & 5 deletions beets/util/__init__.py
Expand Up @@ -776,16 +776,19 @@ def interactive_open(targets, command):

Can raise `OSError`.
"""
assert command

# Split the command string into its arguments.
try:
command = shlex_split(command)
args = shlex_split(command)
except ValueError: # Malformed shell tokens.
command = [command]
command.insert(0, command[0]) # for argv[0]
args = [command]

args.insert(0, args[0]) # for argv[0]

command += targets
args += targets

return os.execlp(*command)
return os.execlp(*args)


def _windows_long_path_name(short_path):
Expand Down
2 changes: 2 additions & 0 deletions beetsplug/play.py
Expand Up @@ -63,6 +63,8 @@ def play_music(self, lib, opts, args):
command passing that playlist, at request insert optional arguments.
"""
command_str = config['play']['command'].get()
if not command_str:
command_str = util.open_anything()
use_folders = config['play']['use_folders'].get(bool)
relative_to = config['play']['relative_to'].get()
raw = config['play']['raw'].get(bool)
Expand Down