The goal was to export all of the passwords stored using pass to JSON format.
Warning
May contain bugs. This code was written with a focus on the result, and it worked for me.
Why did I focus on the result and not worry about other cases? Because when I wrote this, I just wanted to get the job done.
And recently, I realized that "I wanted to do X by doing this and that so blablabla" was just my excuse to delay a job.
Also, this is one of the reasons I love PHP. It allows you to write almost anything, from simple scripts to complex things.
Several months ago, I switched to using Bitwarden for managing my passwords because it is cross-platform and accessible via a web browser.
And because of some reasons, I don't have the time to migrate it manually.
I created this script so that I can at least uninstall pass
and be able to migrate my passwords later.
I share the code because it may useful for someone (and for my future self maybe? hmm).