website icon indicating copy to clipboard operation
website copied to clipboard

check for writable files

Open umeboshi2 opened this issue 7 years ago • 2 comments

I am using fresh to manage dotfiles. This patch will make sure the dotfile is writable before attempting to modify, and will exit with instructions for adding yarn to path if script cannot modify dotfile. I have only tested this for .bashrc on my laptop.

umeboshi2 avatar Feb 25 '17 17:02 umeboshi2

@Daniel15 what do you think?

bestander avatar May 19 '17 11:05 bestander

I think yarn should check if write permission is granted to the profile files but I think the message should be changed a little bit (To say it doesn't have write permission instead of profile not found when it's available!)

and

if [ -z "${YARN_PROFILE-}" ] ; then
    printf "$red> Profile not found. Tried ${YARN_PROFILE} (as defined in \$PROFILE), ~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile.\n"
    echo "> Create one of them and run this script again"

doesn't seem alright to me because the if checks if the variable is empty then it tries to print it! Will discuss this in my other PR where we work on using sh syntax. (not sure & I don't know what - is doing in ${YARN_PROFILE-}...)

badersur avatar Jun 28 '17 20:06 badersur