mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-11-09 05:40:07 +01:00
♻️ Cleanup
This commit is contained in:
@@ -11,7 +11,7 @@ import Foundation
|
||||
class Valet {
|
||||
|
||||
var version: String
|
||||
var config: ValetConfiguration
|
||||
var config: Valet.Configuration
|
||||
var detectedSites: [String]
|
||||
|
||||
init() {
|
||||
@@ -23,7 +23,7 @@ class Valet {
|
||||
.appendingPathComponent(".config/valet/config.json")
|
||||
|
||||
self.config = try! JSONDecoder().decode(
|
||||
ValetConfiguration.self,
|
||||
Valet.Configuration.self,
|
||||
from: try! String(contentsOf: file, encoding: .utf8).data(using: .utf8)!
|
||||
)
|
||||
|
||||
@@ -33,4 +33,12 @@ class Valet {
|
||||
self.detectedSites = []
|
||||
}
|
||||
|
||||
// MARK: - Structs
|
||||
|
||||
struct Configuration: Decodable {
|
||||
let tld: String
|
||||
let paths: [String]
|
||||
let loopback: String
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
//
|
||||
// ValetConfiguration.swift
|
||||
// PHP Monitor
|
||||
//
|
||||
// Created by Nico Verbruggen on 29/11/2021.
|
||||
// Copyright © 2021 Nico Verbruggen. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
class ValetConfiguration: Decodable {
|
||||
let tld: String
|
||||
let paths: [String]
|
||||
let loopback: String
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user