-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eebfa82
commit 0fc7f2c
Showing
10 changed files
with
38 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ import AppKit | |
class Actions { | ||
|
||
public static func detectPhpVersions() -> [String] { | ||
let files = Shell.shared.pipe("ls /usr/local/opt | grep php@") | ||
let files = Shell.user.pipe("ls /usr/local/opt | grep php@") | ||
var versions = files.components(separatedBy: "\n") | ||
// Remove all empty strings | ||
versions.removeAll { (string) -> Bool in | ||
|
@@ -28,14 +28,14 @@ class Actions { | |
|
||
public static func switchToPhpVersion(version: String, availableVersions: [String]) { | ||
availableVersions.forEach { (version) in | ||
Shell.shared.run("brew unlink php@\(version)") | ||
Shell.user.run("brew unlink php@\(version)") | ||
} | ||
if (availableVersions.contains("7.3")) { | ||
Shell.shared.run("brew link [email protected]") | ||
Shell.user.run("brew link [email protected]") | ||
if (version == Constants.LatestPhpVersion) { | ||
Shell.shared.run( "valet use php") | ||
Shell.user.run( "valet use php") | ||
} else { | ||
Shell.shared.run("valet use php@\(version)") | ||
Shell.user.run("valet use php@\(version)") | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,31 +13,31 @@ class Startup { | |
public static func checkEnvironment() | ||
{ | ||
self.presentAlertOnMainThreadIf( | ||
!Shell.shared.pipe("which php").contains("/usr/local/bin/php"), | ||
!Shell.user.pipe("which php").contains("/usr/local/bin/php"), | ||
messageText: "PHP is not correctly installed", | ||
informativeText: "You must install PHP via brew. Try running `which php` in Terminal, it should return `/usr/local/bin/php`. The app will not work correctly until you resolve this issue." | ||
) | ||
|
||
self.presentAlertOnMainThreadIf( | ||
!Shell.shared.pipe("ls /usr/local/opt | grep [email protected]").contains("[email protected]"), | ||
!Shell.user.pipe("ls /usr/local/opt | grep [email protected]").contains("[email protected]"), | ||
messageText: "PHP 7.3 is not correctly installed", | ||
informativeText: "PHP 7.3 alias was not found in `/usr/local/opt`. The app will not work correctly until you resolve this issue." | ||
) | ||
|
||
self.presentAlertOnMainThreadIf( | ||
!Shell.shared.pipe("which valet").contains("/usr/local/bin/valet"), | ||
!Shell.user.pipe("which valet").contains("/usr/local/bin/valet"), | ||
messageText: "Laravel Valet is not correctly installed", | ||
informativeText: "You must install Valet via brew. Try running `which valet` in Terminal, it should return `/usr/local/bin/valet`. The app will not work correctly until you resolve this issue." | ||
) | ||
|
||
self.presentAlertOnMainThreadIf( | ||
!Shell.shared.pipe("cat /private/etc/sudoers.d/brew").contains("/usr/local/bin/brew"), | ||
!Shell.user.pipe("cat /private/etc/sudoers.d/brew").contains("/usr/local/bin/brew"), | ||
messageText: "Brew has not been added to sudoers.d", | ||
informativeText: "You must run `sudo valet trust` to ensure Valet can start and stop services without having to use sudo every time. The app will not work correctly until you resolve this issue." | ||
) | ||
|
||
self.presentAlertOnMainThreadIf( | ||
!Shell.shared.pipe("cat /private/etc/sudoers.d/valet").contains("/usr/local/bin/valet"), | ||
!Shell.user.pipe("cat /private/etc/sudoers.d/valet").contains("/usr/local/bin/valet"), | ||
messageText: "Valet has not been added to sudoers.d", | ||
informativeText: "You must run `sudo valet trust` to ensure Valet can start and stop services without having to use sudo every time. The app will not work correctly until you resolve this issue." | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters