I'm looking for how to recursively copy a directory structure and then fill the copy with symlinks to the corresponding files from the source directory. This has a simple solution in Linux in the form of cp -as
, but cp
seems to lack the s
option on macOS Mojave.
The underlying goal is to automate the process of making applications that do not reside in /Applications
show up in Launchpad.
What would be an elegant, preferrably future proof, alternative to this on macOS?
From doing brew search cp
I get the impression that Homebrew does not have an alternative version of cp
.
Update
Additional information
I'm currently running this regularly, but I want to improve it by making it recursive:
ln -s /<Source app directory>/*.app /Applications
It also has to preserve the directory structure because:
Subdirectories are used to manage sets of applications that are to be excluded from backup, without having to manually change Time Machine settings every time I add a new application. For instance, games are large and do not need to be backed up. Same goes for versions of Xcode.
A mere symlink to a subdirectory does not include its linked target's applications in Launchpad.
A symlinked directory would prevent creating a real directory with the same name. That prevents the source and destination directories from being organised identically.
ditto
” answer to review things like notarization, xattr, ACL and quarantine which are all relevant for/Applications
and macOS changes coming past the initial Catalina release. – bmike♦ Nov 24 '19 at 19:29ditto
-- I'll check it out, thanks. No plans to update to Catalina within the forseeable future though, since I have games that I want to be able to run. – Andreas Nov 24 '19 at 20:01