trapd00r / LS_COLORS

A collection of LS_COLORS definitions; needs your contribution!
Other
2.11k stars 260 forks source link

/tmp/LS_COLORS is not a directory #150

Closed cofirazak closed 4 years ago

cofirazak commented 4 years ago

An installation script is provided with this repository: $ wget https://raw.github.com/trapd00r/LS_COLORS/master/LS_COLORS -O /tmp/LS_COLORS $ ( cd /tmp/LS_COLORS && sh /tmp/LS_COLORS/install.sh )

Problem: cd: not a directory: /tmp/LS_COLORS because wget downloads a file.

rpdelaney commented 4 years ago

Thanks for the report, that was an oversight on my part. Could you give this a try? If it works for you I will update the readme.

mkdir /tmp/LS_COLORS && curl -L https://api.github.com/repos/trapd00r/LS_COLORS/tarball/master | tar xzf - --directory=/tmp/LS_COLORS --strip=1
( cd /tmp/LS_COLORS && sh /tmp/LS_COLORS/install.sh )
cofirazak commented 4 years ago

the first command works ok now, but the second is failing on dircolors: command not found this is on mac os because there is no dircolor there there is a workaround with brew install coreutils and after that there is gdircolors

cofirazak commented 4 years ago

more over there is no -t flag for mv on mac os so the script fails

rpdelaney commented 4 years ago

I think the homebrew formula for coreutils has an option to install without the prefix, although that may cause compatibility problems elsewhere. You could also try with aliases like alias tar='gtar'. I don't think we can support every platform in the docs.

abanks7 commented 4 years ago

Using the tarball method worked for me as far as getting to the point of running install.sh which made the .local/share/lscolors.sh but I cannot get it work after that.

rpdelaney commented 4 years ago

@abanks7 Please paste your console output including what you did & the error you received. You can use fenced code blocks with github markdown to make it readable. Thanks

abanks7 commented 4 years ago

I should have been more clear but I didn't want to clutter this issue up since I'm not sure its relevant to the topic on hand.

I'm not getting any actual errors, just not getting the correct color output. LS_COLORS variable is being set correctly (I compared some of the values to the file) but any form of ls --color is not giving correct color output.

rpdelaney commented 4 years ago

Usually that's caused by problems with the terminal emulator or TERM env var. Most *nix terminal emulators support TERM=xterm-256color so try that maybe. Feel free to open a separate issue if you want to continue, but it's hard to troubleshoot various terminal emulators out there.

abanks7 commented 4 years ago

I do have TERM=xterm-256color but you're right there are too many different combos out there and it's hard to cater to all of them. It's probably user error... 😆 but I'll keep at it.

Thanks for the help, and to sum up the original issue: the wget method in the current README does not work correctly but the tarbell method you provided works perfectly.

cofirazak commented 4 years ago

@rpdelaney @abanks7 I managed to work it. OS: mac os Catalina 10.15.3 Terminal emulator: iTerm 2 Build 3.3.9 Unix shell: zsh Plugin framework for ZSH: Oh-My-Zsh

Installation steps: 1) brew install coreutils 2) wget https://raw.github.com/trapd00r/LS_COLORS/master/LS_COLORS -O $HOME/LS_COLORS 3) add to ~/.zshrc BEFORE source $ZSH/oh-my-zsh.sh the following line: eval $(gdircolors -b $HOME/LS_COLORS) 4) restart iTerm2