tilt icon indicating copy to clipboard operation
tilt copied to clipboard

Listing directories

Open remram44 opened this issue 4 years ago • 2 comments

Describe the Feature You Want

It should be possible to list subdirectories.

Current Behavior

listdir() lists files only, not directories.

Why Do You Want This?

I am building the live_update config for my app. Some directories are ok to live-reload (so I use sync()), and I want all others to go into fall_back_on().

Additional context There should probably be a way to tell whether a path is a file or a directory (like Python's isfile() and isdir()).

I managed to hack together a list of (non-empty) subdirectories from the recursive list of files: gist. This works but is a huge hack (and the / handling is probably not portable)

remram44 avatar Dec 09 '21 23:12 remram44

ya - listdir was added very early on and has a bunch of semantics that made sense at the time, but are very different from python's os.listdir. I wonder if we should simply deprecate it and add a new os.listdir that matches the python semantics.

related issue: https://github.com/tilt-dev/tilt/issues/3806

nicks avatar Dec 10 '21 15:12 nicks

Hi folks, is there any updatae regarding this issue?

razdob15 avatar Feb 24 '25 12:02 razdob15