mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-07 12:00:09 +02:00
👌 Clean up how file checks are done
This commit is contained in:
@ -73,10 +73,9 @@ class Shell {
|
||||
|
||||
/**
|
||||
Checks if a file exists at the provided path.
|
||||
Uses `/bin/echo` instead of the `builtin` (which does not support `-n`).
|
||||
*/
|
||||
public static func fileExists(_ path: String) -> Bool {
|
||||
return Shell.pipe(
|
||||
"if [ -f \(path) ]; then echo \"PHP_Y_FE\"; fi"
|
||||
).contains("PHP_Y_FE")
|
||||
return Shell.pipe("if [ -f \(path) ]; then /bin/echo -n \"0\"; fi") == "0"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user