Skip to content

Commit

Permalink
Fix TYPO3 project detection to work with non existent symlinks, fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbertsoft committed Oct 25, 2022
1 parent d0c5f1b commit bb5b264
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/ddevapp/typo3.go
Expand Up @@ -152,9 +152,18 @@ func setTypo3SiteSettingsPaths(app *DdevApp) {

// isTypoApp returns true if the app is of type typo3
func isTypo3App(app *DdevApp) bool {
if _, err := os.Stat(filepath.Join(app.AppRoot, app.Docroot, "typo3")); err == nil {
typo3Folder := filepath.Join(app.AppRoot, app.Docroot, "typo3")

// Check if the folder exists, fails if a symlink target does not exist.
if _, err := os.Stat(typo3Folder); !os.IsNotExist(err) {
return true
}

// Check if a symlink exists, succeeds even if the target does not exist.
if _, err := os.Lstat(typo3Folder); !os.IsNotExist(err) {
return true
}

return false
}

Expand Down

0 comments on commit bb5b264

Please sign in to comment.