I have code which I use accross multiple my Elixir projects. I have it locally. This includes bash, javascript scripts as well as Elixir code.
What’s the best way to edit it in one place and use the most recent version of it in all the projects? I don’t want to keep doing copy-paste to each project each time I update it.
Should I create a separate project “shared_code” and a special bash script which will copy and overwrite the latest version to each real project?
Or is there a smarter way to refer to it from each project? “ln -s” won’t work, will it?
You could store these scripts in a separate git repository (if you are using a git repository) and add this repository to your projects as a git submodule (https://git-scm.com/book/en/v2/Git-Tools-Submodules). This allows you to track things when they change and pull the latest code without having to do things manually.