AFAIK, the bash script has low control over command execution and controlling the results of the command. It is necessary to switch to a compiled language like golang which has more control over command execution and control over command results.
+------------------------------------------------------------------------+
|!!WARNING!!|||| This script overwrite the files located in the /Users/<username>/ directory. || (e.g. /Users/<username>/.bashrc, /Users/<username>/.zshrc etc.) |||
+------------------------------------------------------------------------+
Do you wanna continue? [y]es/[N]o:
y
[+] /Users/<username>/.oh-my-zsh found, skipping.
[!] DEBUG mode enabled, dotfiles copied from /Users/<username>
[#] copy dotfiles from /tmp/dotfiles to /Users/<username>
cp: /Users/<username>/.bashrc: No such file or directory
cp: /Users/<username>/.p10k.zsh: No such file or directory
cp: /Users/<username>/.vimrc: No such file or directory
cp: /Users/<username>/.zshrc and /Users/<username>/.zshrc are identical (not copied).