lando / core

Current Lando v3 runtime
https://docs.lando.dev/core/v3
GNU General Public License v3.0
4 stars 18 forks source link

Fixes EISDIR corrective action creating new EISDIR errors later #169

Open AaronFeledy opened 2 weeks ago

AaronFeledy commented 2 weeks ago

Fixes this error I ran into:

Error: EISDIR: illegal operation on a directory, unlink '/home/aaron/.lando/config/pantheon/drupal10.conf.tpl'

Seems some error case gets checked to see if a directory can be created. This is problematic if the f getting passed to mkdir is a file name. When there is now a directory with the path and name of one of our files, subsequent runs of this function will attempt to put the file where there is now a directory with the same name. It breaks because unlinking a directory is not possible.

I added a function to remove the directory that got created during the mkdir in the conditional above it. It's equivalent to an rm -rf so it won't throw a new error if f doesn't exist.

netlify[bot] commented 2 weeks ago

Deploy Preview for lando-core ready!

Name Link
Latest commit c13638e291ee869579b30dde14be8f330c000325
Latest deploy log https://app.netlify.com/sites/lando-core/deploys/664551812ebb2900089ae304
Deploy Preview https://deploy-preview-169--lando-core.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

Lighthouse
1 paths audited
Performance: 91 (🟢 up 2 from production)
Accessibility: 98 (no change from production)
Best Practices: 100 (no change from production)
SEO: 93 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

AaronFeledy commented 2 weeks ago

lando/lando#2051