<p>All my kustomize declarations for my kubernetes cluster are stored in a folder with this structure:</p>
<pre><code>.  
├── apps  
│   └── nginx-test  
│       ├── base  
│       │   ├── deployment.yaml  
│       │   ├── ingress.yaml  
│       │   ├── kustomization.yaml  
│       │   ├── namespace.yaml  
│       │   └── service.yaml  
│       ├── dev  
│       │   ├── ingress.yaml  
│       │   └── kustomization.yaml  
│       └── tollana  
│           ├── ingress.yaml  
│           └── kustomization.yaml  
├── infra  
│   ├── cert-manager  
│   │   ├── base  
│   │   │   ├── helmChart.yaml  
│   │   │   ├── kustomization.yaml  
│   │   │   ├── namespace.yaml  
│   │   │   └── values.yaml  
│   │   ├── dev  
│   │   │   └── kustomization.yaml  
│   │   └── tollana  
│   │       └── kustomization.yaml  
│   ├── enroute  
│   │   ├── base  
│   │   │   ├── helmChart.yaml  
│   │   │   ├── kustomization.yaml  
│   │   │   ├── namespace.yaml  
│   │   │   └── values.yaml  
│   │   ├── dev  
│   │   │   ├── add-namespace.yaml  
│   │   │   ├── externalIP.yaml  
│   │   │   └── kustomization.yaml  
│   │   └── tollana  
│   │       ├── add-namespace.yaml  
│   │       ├── externalIP.yaml  
│   │       └── kustomization.yaml  
</code></pre>
<p>I want to have tilt to sync all kustomizations in the dev directories. So far I got this:</p>
<pre><code>baseFolders = [&quot;./apps&quot;, &quot;./infra&quot;]
for folder in baseFolders:
    appFolders = listdir(folder)
    for appFolder in appFolders:
        if os.path.exists(&quot;kubectl kustomize --enable-helm {}/dev/kustomization.yaml&quot;).format(os.path.join(folder, appFolder)):
            k8s_yaml(local(&quot;kubectl kustomize --enable-helm {}/dev&quot;).format(os.path.join(folder, appFolder)))
</code></pre>
<p>But <code>listdir(&quot;directory&quot;)</code> only lists the files in <em>directory</em>.
Is there a way to get all folders in a specific directory?</p>
<p><code>os.listdir()</code> doesn't work:</p>
<pre><code>Error: module has no .listdir field or method
</code></pre>

<p>This behaviour is not supported (yet). There is an open issue for it: <a href="https://github.com/tilt-dev/tilt/issues/5268" rel="nofollow noreferrer">https://github.com/tilt-dev/tilt/issues/5268</a></p>
