Skip to content

Expand tilde home path in prepare doc

Michael Kozono requested to merge expand-tilde-home-path into master

Before

➜  gdk git:(master) if [ ${ZSH_VERSION} ]; then shell_file='~/.zshrc'; else shell_file='~/.bash_profile'; fi
➜  gdk git:(master) ls $shell_file                                                                          
ls: ~/.zshrc: No such file or directory
➜  gdk git:(master) ls ${shell_file}
ls: ~/.zshrc: No such file or directory

The lines using shell_file failed in the same way.

After

➜  gitlab git:(master) if [ ${ZSH_VERSION} ]; then shell_file="${HOME}/.zshrc"; else shell_file="${HOME}/.bash_profile"; fi
➜  gitlab git:(master) ls $shell_file
/Users/mkozonogitlab/.zshrc
➜  gitlab git:(master) ls ${shell_file}
/Users/mkozonogitlab/.zshrc
Original proposal
➜  gdk git:(master) if [ ${ZSH_VERSION} ]; then shell_file=~/'.zshrc'; else shell_file=~/'.bash_profile'; fi
➜  gdk git:(master) ls $shell_file                                                                         
/Users/mkozonogitlab/.zshrc
➜  gdk git:(master) ls ${shell_file}                                                                        
/Users/mkozonogitlab/.zshrc

I don't know all the implications and why it didn't work on my system but presumably did on others.

Edited by Michael Kozono

Merge request reports