save repository signing keys in right location for apt
The function add_apt_repo is used for download_sublime, which is needed for install sublime_text.
In order to download the package, the GPG key is downloaded from the Sublime website and added to a new keyring using apt-key. To get apt to use this keyring, it should be saved in /etc/apt/trusted.gpg.d/.
Well you can remove this entire section --keyring /etc/apt/trusted.gpg.d/${4}.gpg if that's the case
You're right. Since the script originally included --keyring ${4}.gpg I assumed you preferred to save the key in a separate file. I would prefer putting it in /etc/apt/trusted.gpg.d/, as it matches the way third party repositories are usually stored in /etc/apt/sources.list.d/.
The added benefits of using separate files for third party software is that it allows for more configuration using apt, while allowing less experienced users to remove these repos by simply deleting the files, instead of having to use specific apt commands.
I would prefer it too but it seems that it doesn't work. I have the same issue with Sublime repo