Skip to content

sed errors out when deleting a bookmark on MacOS #23

@ankur-gupta

Description

@ankur-gupta

I've been using fishmarks for a long time. Recently, I noticed that deleting a bookmark errors out due to sed. Here's how this looks like:

ankur@MauiCovenant ~/L/A/S/P/User> s st3user
ankur@MauiCovenant ~/L/A/S/P/User> l
st3user              /Users/ankur/Library/Application Support/Sublime Text/Packages/User
ankur@MauiCovenant ~/L/A/S/P/User> d st3user
sed: illegal option -- -
usage: sed script [-Ealnru] [-i extension] [file ...]
	sed [-Ealnu] [-i extension] [-e script] ... [-f script_file] ... [file ...]

I notice that the error is due to this line in fishmarks/marks.fish's delete_bookmark function:

sed --follow-symlinks -i='' "/DIR_$argv[1]=/d" $SDIRS

The error exists if I reorder the --follow-symlinks option:

sed -i='' --follow-symlinks "/DIR_$argv[1]=/d" $SDIRS

But, error disappears when I change the above line to

sed -i --follow-symlinks "/DIR_$argv[1]=/d" $SDIRS

I see that -i='' was added in #1. I don't know if -i='' is still needed. I did a test on MacOS and it seems that a fishmark associated with a relocated folder can still be deleted with only -i --follow-symlinks without needing =''. Let me know what you think. Thanks!

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