Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions sack
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,18 @@ create_shortcut_cmd_vscode() {
chmod +x $sack__shortcut_cmd_path
}

# Open shortcut using atom
create_shortcut_cmd_atom() {

sack__shortcut_cmd_path=$sack__shortcut_path/$sack__shortcut_cmd
echo "#!/bin/bash" > $sack__shortcut_cmd_path
echo "sack__atom_shortcut=\$(sed -n \"\$1p\" < $sack__shortcut_file)" >> $sack__shortcut_cmd_path
echo "fp=\`echo \$sack__atom_shortcut | awk '{ print \$2 }'\`" >> $sack__shortcut_cmd_path
echo "ln=\`echo \$sack__atom_shortcut | awk '{ print \$1 }'\`" >> $sack__shortcut_cmd_path
echo "$sack__default_editor \$fp:\$ln" >> $sack__shortcut_cmd_path
chmod +x $sack__shortcut_cmd_path
}

# Switch to a different profile
switchprofile() {
# Get the specified profile name from cmdline
Expand Down Expand Up @@ -592,6 +604,8 @@ elif [ $sack__default_editor == 'rsub' ]; then
create_shortcut_cmd_rsub
elif [ $sack__default_editor == 'code' ]; then
create_shortcut_cmd_vscode
elif [ $sack__default_editor == 'atom' ]; then
create_shortcut_cmd_atom
else
echo "Error: unsupported default editor specified in sack__default_editor"
fi