1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2026-03-28 23:00:07 +01:00

♻️ Cleanup phase 1

This commit is contained in:
2025-10-16 14:04:53 +02:00
parent 5b63211746
commit 91d7a4bf44
6 changed files with 24 additions and 7 deletions

View File

@@ -117,7 +117,6 @@ public struct TestableConfiguration: Codable {
// MARK: Interactions // MARK: Interactions
#warning("This method should replace the container's resolved classes with the fake ones.")
func apply() { func apply() {
Log.separator() Log.separator()
Log.info("USING TESTABLE CONFIGURATION...") Log.info("USING TESTABLE CONFIGURATION...")

View File

@@ -119,7 +119,8 @@ class Startup {
// ================================================================================= // =================================================================================
EnvironmentCheck( EnvironmentCheck(
command: { command: {
return await !App.shared.container.shell.pipe("ls \(App.shared.container.paths.optPath) | grep php").out.contains("php") return await !App.shared.container.shell
.pipe("ls \(App.shared.container.paths.optPath) | grep php").out.contains("php")
}, },
name: "`ls \(App.shared.container.paths.optPath) | grep php` returned php result", name: "`ls \(App.shared.container.paths.optPath) | grep php` returned php result",
titleText: "startup.errors.php_opt.title".localized, titleText: "startup.errors.php_opt.title".localized,
@@ -176,14 +177,16 @@ class Startup {
// functioning correctly. Let the user know that they need to run `valet trust`. // functioning correctly. Let the user know that they need to run `valet trust`.
// ================================================================================= // =================================================================================
EnvironmentCheck( EnvironmentCheck(
command: { return await !App.shared.container.shell.pipe("cat /private/etc/sudoers.d/brew").out.contains(App.shared.container.paths.brew) }, command: { return await !App.shared.container.shell
.pipe("cat /private/etc/sudoers.d/brew").out.contains(App.shared.container.paths.brew) },
name: "`/private/etc/sudoers.d/brew` contains brew", name: "`/private/etc/sudoers.d/brew` contains brew",
titleText: "startup.errors.sudoers_brew.title".localized, titleText: "startup.errors.sudoers_brew.title".localized,
subtitleText: "startup.errors.sudoers_brew.subtitle".localized, subtitleText: "startup.errors.sudoers_brew.subtitle".localized,
descriptionText: "startup.errors.sudoers_brew.desc".localized descriptionText: "startup.errors.sudoers_brew.desc".localized
), ),
EnvironmentCheck( EnvironmentCheck(
command: { return await !App.shared.container.shell.pipe("cat /private/etc/sudoers.d/valet").out.contains(App.shared.container.paths.valet) }, command: { return await !App.shared.container.shell
.pipe("cat /private/etc/sudoers.d/valet").out.contains(App.shared.container.paths.valet) },
name: "`/private/etc/sudoers.d/valet` contains valet", name: "`/private/etc/sudoers.d/valet` contains valet",
titleText: "startup.errors.sudoers_valet.title".localized, titleText: "startup.errors.sudoers_valet.title".localized,
subtitleText: "startup.errors.sudoers_valet.subtitle".localized, subtitleText: "startup.errors.sudoers_valet.subtitle".localized,

View File

@@ -59,7 +59,8 @@ class BrewDiagnostics {
Determines whether to use the regular `nginx` or `nginx-full` formula. Determines whether to use the regular `nginx` or `nginx-full` formula.
*/ */
public var usesNginxFullFormula: Bool { public var usesNginxFullFormula: Bool {
guard let destination = try? filesystem.getDestinationOfSymlink("\(container.paths.binPath)/nginx") else { return false } guard let destination = try? filesystem
.getDestinationOfSymlink("\(container.paths.binPath)/nginx") else { return false }
// Verify that the `nginx` binary is symlinked to a directory that includes `nginx-full`. // Verify that the `nginx` binary is symlinked to a directory that includes `nginx-full`.
return destination.contains("/nginx-full/") return destination.contains("/nginx-full/")

View File

@@ -12,6 +12,20 @@
}, },
"testTargets" : [ "testTargets" : [
{
"target" : {
"containerPath" : "container:PHP Monitor.xcodeproj",
"identifier" : "C471E7AC28F9B4940021E251",
"name" : "Feature Tests"
}
},
{
"target" : {
"containerPath" : "container:PHP Monitor.xcodeproj",
"identifier" : "C471E7BB28F9B90F0021E251",
"name" : "UI Tests"
}
},
{ {
"parallelizable" : false, "parallelizable" : false,
"target" : { "target" : {