Skip to content

Commit

Permalink
v0.4
Browse files Browse the repository at this point in the history
* minor improvements + bug fixes
* QuickAction v1.0.1
  • Loading branch information
JayBrown committed Oct 23, 2020
1 parent 38a40d7 commit c629aec
Show file tree
Hide file tree
Showing 3 changed files with 325 additions and 116 deletions.
33 changes: 26 additions & 7 deletions Linker_QuickAction.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
#!/bin/zsh
# shellcheck shell=bash

# Linker Finder QuickAction
# version 1.0.0
# Linker Finder QuickAction (workflow)
# version 1.0.1

export LANG=en_US.UTF-8
export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/opt/local/bin:/opt/sw/bin:/sw/bin:$HOME/.local/bin:$HOME/local/bin:$HOME/bin:$HOME/Developer/bin
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/opt/local/bin:/opt/sw/bin:/sw/bin:"$HOME"/.local/bin:"$HOME"/local/bin:"$HOME"/bin:"$HOME"/Developer/bin

if ! command -v linker &>/dev/null ; then
account=$(id -u)
osascript &>/dev/null << EOT
xattr -c /usr/local/bin/linker 2>/dev/null
xattr -c /opt/local/bin/linker 2>/dev/null
xattr -c /opt/sw/bin/linker 2>/dev/null
xattr -c /sw/bin/linker 2>/dev/null
xattr -c "$HOME"/.local/bin/linker 2>/dev/null
xattr -c "$HOME"/local/bin/linker 2>/dev/null
xattr -c "$HOME"/bin/linker 2>/dev/null
xattr -c "$HOME"/Developer/bin/linker 2>/dev/null
chmod +x /usr/local/bin/linker 2>/dev/null
chmod +x /opt/local/bin/linker 2>/dev/null
chmod +x /opt/sw/bin/linker 2>/dev/null
chmod +x /sw/bin/linker 2>/dev/null
chmod +x "$HOME"/.local/bin/linker 2>/dev/null
chmod +x "$HOME"/local/bin/linker 2>/dev/null
chmod +x "$HOME"/bin/linker 2>/dev/null
chmod +x "$HOME"/Developer/bin/linker 2>/dev/null
if ! command -v linker &>/dev/null ; then
account=$(id -u)
osascript &>/dev/null << EOT
beep
tell application "System Events"
display notification "Linker main script not found!" with title "Linker [" & "$account" & "]" subtitle "❌ Error: \$PATH"
display notification "Main Linker shell script not found!" with title "Linker QuickAction [" & "$account" & "]" subtitle "❌ Error: \$PATH"
end tell
EOT
exit
exit
fi
fi

linker "$@" &
Expand Down
12 changes: 7 additions & 5 deletions README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Linker is a macOS shell script and Finder QuickAction to create relative or absolute symbolic links, hard links, Finder aliases, file clones or legacy file copies
Linker is a macOS shell script and Finder QuickAction to create relative or absolute symbolic links, hard links, Finder aliases, Bookmark files, file clones or legacy file copies

Latest release: https://github.com/JayBrown/Linker/releases/latest

Expand All @@ -16,14 +16,16 @@ Latest release: https://github.com/JayBrown/Linker/releases/latest

* execute the following, if the script doesn't run: chmod +x ./linker

* install QuickAction (workflow) with Automator Installer
* Mojave & later: install QuickAction workflow with Automator Installer
* on older systems the QuickAction format is either not supported or might not work properly as a Service workflow, and you need to create your own Service workflow in Automator

In Finder you can just use the QuickAction from the contextual menu.
In Finder you can just use the QuickAction from the contextual menu (or the Service on older systems).

You will have the following options on the command-line, for tool integration in file managers like Nimble Commander, or via the Touch Bar using BetterTouchTool:

linker
-a : create Finder alias
-a : create Finder Alias
-b : create Bookmark file (same as Finder Alias on newer systems)
-c : create cloned file copy (only on APFS)
-d : create legacy file copy (true duplicate)
-h : create hard link (only on HFS+ volumes)
Expand All @@ -32,5 +34,5 @@ linker

Please note that even the above options will still use the GUI for the user to select the destination directory.

Linker uses a code snippet from StackExchange: https://unix.stackexchange.com/a/85068/222515
Linker uses a modified code snippet from StackExchange: https://unix.stackexchange.com/a/85068/222515
Linker comes bundled with the alisma tool by EclecticLight: https://eclecticlight.co/downloads
Loading

0 comments on commit c629aec

Please sign in to comment.