sdkman / sdkman-cli

The SDKMAN! Command Line Interface
https://sdkman.io
Apache License 2.0
6.08k stars 629 forks source link

OS-generated files ends up as local version in list of available candidate versions #163

Closed rlovtangen closed 6 years ago

rlovtangen commented 11 years ago

Some common OS-generated files could probably be filtered from the list of available candidate versions. Here .DS_Store ends up in the list because Finder created a .DS_Store under ~/.gvm/grails:

$ gvm list grails

============================================================
Available Grails Versions
============================================================
   + dev
   + .DS_Store
   * 2.2.2
   * 2.2.1
 > * 2.2.0
     2.1.5
     2.1.4
kenliu commented 11 years ago

+1

marc0der commented 11 years ago

Naughty OSX. Can I confirm that the .DS_Store file is the only one causing problems here?

rlovtangen commented 11 years ago

Don't know if .DS_Store is the only one, but if there's an easy way to distinguish between files and folders, I guess we can safely list folders only? Symlinks to folders must be listed as well.

marc0der commented 11 years ago

True, although OSX also creates disgusting temp folders when creating zip archives from finder. A bunch of folders and files starting with .__ if I remember right.

bpieber commented 7 years ago

I also have this problem with .DS_Store

McPringle commented 6 years ago

This is still an annoying bug…

marc0der commented 6 years ago

Sure, it would be easy to fix too. Want to submit a PR?

On Sat, 21 Oct 2017 at 10:15 Marcus Fihlon notifications@github.com wrote:

This is still an annoying bug…

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sdkman/sdkman-cli/issues/163#issuecomment-338377540, or mute the thread https://github.com/notifications/unsubscribe-auth/AAI0BtTxYiygBjshprR6k-LXbUebh3VVks5subYrgaJpZM4Aohi_ .

marc0der commented 6 years ago

Re-opening issue due to warnings in the console:

find: warning: you have specified the -maxdepth option after a non-option argument (, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it).  Please specify options before other arguments.
McPringle commented 6 years ago

Do you have a context, please? Which OS version? Maybe the find command behaves a little bit different. I'll investigate tomorrow.

marc0der commented 6 years ago

Sure no probs, here is the archey dump:

               +                
               #                
              ###               
             #####              
             ######             
            ; #####;            User: marco
           +##.#####            Hostname: scopuli
          +##########           Distro: Arch Linux
         #############;         Kernel: 4.14.4-1-ARCH
        ###############+        Uptime: 1 day, 10:49
       #######   #######        Window Manager: 
     .######;     ;###;`".      Desktop Environment: 
    .#######;     ;#####.       Shell: /bin/zsh
    #########.   .########`     Terminal: xterm-256color
   ######'           '######    Packages: 870
  ;####                 ####;   CPU: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz
  ##'                     '##   RAM: 6343 MB / 15771 MB 
 #'                         `#  Disk: 97GB / 493GB
McPringle commented 6 years ago

I don't have ArchLinux but I have a VM running Ubuntu. I was able to reproduce the warning of the find command on Ubuntu and fixed it by swapping the parameters.

marc0der commented 6 years ago

@McPringle Okay, I've tested this on all platforms and seems to work well now. I've released this on stable as 5.5.15. Thanks for the great work!