This is a very fragile implementation of this, but I didn't want to add any dependencies to this script since I want it to be able to portable above all else. If anyone has a better solution I would love to hear it.