mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-08 04:20:07 +02:00
30 lines
755 B
Swift
30 lines
755 B
Swift
//
|
|
// ValetProxyScanner.swift
|
|
// PHP Monitor
|
|
//
|
|
// Created by Nico Verbruggen on 11/04/2022.
|
|
// Copyright © 2022 Nico Verbruggen. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
class ValetProxyScanner: ProxyScanner {
|
|
func resolveProxies(directoryPath: String) -> [ValetProxy] {
|
|
return try! FileManager
|
|
.default
|
|
.contentsOfDirectory(atPath: directoryPath)
|
|
.filter {
|
|
return !$0.starts(with: ".")
|
|
}
|
|
.compactMap {
|
|
return NginxConfigurationFile.from(filePath: "\(directoryPath)/\($0)")
|
|
}
|
|
.filter {
|
|
return $0.proxy != nil
|
|
}
|
|
.map {
|
|
return ValetProxy($0)
|
|
}
|
|
}
|
|
}
|