mirror of
https://github.com/ninxsoft/Mist.git
synced 2025-05-24 12:07:14 -04:00
Removed unused declarations
This commit is contained in:
parent
66aa4a463c
commit
1759a1b420
8 changed files with 0 additions and 114 deletions
|
@ -123,8 +123,6 @@
|
||||||
39CF562F2862A797006FB5D2 /* ISOConverter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39CF562E2862A797006FB5D2 /* ISOConverter.swift */; };
|
39CF562F2862A797006FB5D2 /* ISOConverter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39CF562E2862A797006FB5D2 /* ISOConverter.swift */; };
|
||||||
39CF56312862A8C5006FB5D2 /* InstallMediaCreator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39CF56302862A8C5006FB5D2 /* InstallMediaCreator.swift */; };
|
39CF56312862A8C5006FB5D2 /* InstallMediaCreator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39CF56302862A8C5006FB5D2 /* InstallMediaCreator.swift */; };
|
||||||
39CF56332862B7A2006FB5D2 /* PackageCreator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39CF56322862B7A2006FB5D2 /* PackageCreator.swift */; };
|
39CF56332862B7A2006FB5D2 /* PackageCreator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39CF56322862B7A2006FB5D2 /* PackageCreator.swift */; };
|
||||||
39CF56352862D4BF006FB5D2 /* FileCompressor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39CF56342862D4BF006FB5D2 /* FileCompressor.swift */; };
|
|
||||||
39CF56392862D75D006FB5D2 /* FileCreator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39CF56382862D75D006FB5D2 /* FileCreator.swift */; };
|
|
||||||
39D68B892861369B00A7848C /* InstallerCreator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39D68B882861369B00A7848C /* InstallerCreator.swift */; };
|
39D68B892861369B00A7848C /* InstallerCreator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39D68B882861369B00A7848C /* InstallerCreator.swift */; };
|
||||||
39FF05EE2859820900A86670 /* AppCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39FF05ED2859820900A86670 /* AppCommands.swift */; };
|
39FF05EE2859820900A86670 /* AppCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39FF05ED2859820900A86670 /* AppCommands.swift */; };
|
||||||
39FF05F02859848500A86670 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39FF05EF2859848500A86670 /* SettingsView.swift */; };
|
39FF05F02859848500A86670 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39FF05EF2859848500A86670 /* SettingsView.swift */; };
|
||||||
|
@ -265,8 +263,6 @@
|
||||||
39CF562E2862A797006FB5D2 /* ISOConverter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ISOConverter.swift; sourceTree = "<group>"; };
|
39CF562E2862A797006FB5D2 /* ISOConverter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ISOConverter.swift; sourceTree = "<group>"; };
|
||||||
39CF56302862A8C5006FB5D2 /* InstallMediaCreator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstallMediaCreator.swift; sourceTree = "<group>"; };
|
39CF56302862A8C5006FB5D2 /* InstallMediaCreator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstallMediaCreator.swift; sourceTree = "<group>"; };
|
||||||
39CF56322862B7A2006FB5D2 /* PackageCreator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PackageCreator.swift; sourceTree = "<group>"; };
|
39CF56322862B7A2006FB5D2 /* PackageCreator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PackageCreator.swift; sourceTree = "<group>"; };
|
||||||
39CF56342862D4BF006FB5D2 /* FileCompressor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileCompressor.swift; sourceTree = "<group>"; };
|
|
||||||
39CF56382862D75D006FB5D2 /* FileCreator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileCreator.swift; sourceTree = "<group>"; };
|
|
||||||
39D68B882861369B00A7848C /* InstallerCreator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstallerCreator.swift; sourceTree = "<group>"; };
|
39D68B882861369B00A7848C /* InstallerCreator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstallerCreator.swift; sourceTree = "<group>"; };
|
||||||
39FF05ED2859820900A86670 /* AppCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppCommands.swift; sourceTree = "<group>"; };
|
39FF05ED2859820900A86670 /* AppCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppCommands.swift; sourceTree = "<group>"; };
|
||||||
39FF05EF2859848500A86670 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
|
39FF05EF2859848500A86670 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
|
||||||
|
@ -376,8 +372,6 @@
|
||||||
39CF56232861CA85006FB5D2 /* DiskImageUnmounter.swift */,
|
39CF56232861CA85006FB5D2 /* DiskImageUnmounter.swift */,
|
||||||
3935F47D2864813B00760AB0 /* DownloadManager.swift */,
|
3935F47D2864813B00760AB0 /* DownloadManager.swift */,
|
||||||
39CA25E22941D8BB0030711E /* FileAttributesUpdater.swift */,
|
39CA25E22941D8BB0030711E /* FileAttributesUpdater.swift */,
|
||||||
39CF56382862D75D006FB5D2 /* FileCreator.swift */,
|
|
||||||
39CF56342862D4BF006FB5D2 /* FileCompressor.swift */,
|
|
||||||
39CF56162861BE66006FB5D2 /* FileCopier.swift */,
|
39CF56162861BE66006FB5D2 /* FileCopier.swift */,
|
||||||
398734C728601FFC00B4C357 /* FileMover.swift */,
|
398734C728601FFC00B4C357 /* FileMover.swift */,
|
||||||
39D68B882861369B00A7848C /* InstallerCreator.swift */,
|
39D68B882861369B00A7848C /* InstallerCreator.swift */,
|
||||||
|
@ -815,7 +809,6 @@
|
||||||
39148CFC28DD55B300011FF5 /* PathControl.swift in Sources */,
|
39148CFC28DD55B300011FF5 /* PathControl.swift in Sources */,
|
||||||
3935F4892866C68000760AB0 /* DownloadSectionHeaderView.swift in Sources */,
|
3935F4892866C68000760AB0 /* DownloadSectionHeaderView.swift in Sources */,
|
||||||
39252AB5285C706000956C74 /* URL+Extension.swift in Sources */,
|
39252AB5285C706000956C74 /* URL+Extension.swift in Sources */,
|
||||||
39CF56352862D4BF006FB5D2 /* FileCompressor.swift in Sources */,
|
|
||||||
390451D828573A2500E0B563 /* ExportListView.swift in Sources */,
|
390451D828573A2500E0B563 /* ExportListView.swift in Sources */,
|
||||||
39FF05EE2859820900A86670 /* AppCommands.swift in Sources */,
|
39FF05EE2859820900A86670 /* AppCommands.swift in Sources */,
|
||||||
39252AA3285C3CC400956C74 /* CodesigningPickerView.swift in Sources */,
|
39252AA3285C3CC400956C74 /* CodesigningPickerView.swift in Sources */,
|
||||||
|
@ -833,7 +826,6 @@
|
||||||
39CB5E3F2941486D00CFDBB8 /* CatalogSeedType.swift in Sources */,
|
39CB5E3F2941486D00CFDBB8 /* CatalogSeedType.swift in Sources */,
|
||||||
39252A7F285AC6F600956C74 /* SettingsPackagesView.swift in Sources */,
|
39252A7F285AC6F600956C74 /* SettingsPackagesView.swift in Sources */,
|
||||||
39CF562F2862A797006FB5D2 /* ISOConverter.swift in Sources */,
|
39CF562F2862A797006FB5D2 /* ISOConverter.swift in Sources */,
|
||||||
39CF56392862D75D006FB5D2 /* FileCreator.swift in Sources */,
|
|
||||||
39FF05FA285985DD00A86670 /* SettingsAboutView.swift in Sources */,
|
39FF05FA285985DD00A86670 /* SettingsAboutView.swift in Sources */,
|
||||||
3935F4AC286B04BC00760AB0 /* HelperToolLaunchdPropertyList.swift in Sources */,
|
3935F4AC286B04BC00760AB0 /* HelperToolLaunchdPropertyList.swift in Sources */,
|
||||||
39FF05F42859850500A86670 /* SettingsGeneralView.swift in Sources */,
|
39FF05F42859850500A86670 /* SettingsGeneralView.swift in Sources */,
|
||||||
|
|
|
@ -5,9 +5,6 @@
|
||||||
// Created by Nindi Gill on 13/6/2022.
|
// Created by Nindi Gill on 13/6/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
|
||||||
import Yams
|
|
||||||
|
|
||||||
extension Dictionary where Key == String {
|
extension Dictionary where Key == String {
|
||||||
|
|
||||||
func firmwareCSVString() -> String {
|
func firmwareCSVString() -> String {
|
||||||
|
@ -41,18 +38,4 @@ extension Dictionary where Key == String {
|
||||||
let string: String = "\"\(identifier)\",\"\(name)\",\"=\"\"\(version)\"\"\",\"=\"\"\(build)\"\"\",\(size),\(date),\(compatible ? "YES" : "NO")\n"
|
let string: String = "\"\(identifier)\",\"\(name)\",\"=\"\"\(version)\"\"\",\"=\"\"\(build)\"\"\",\(size),\(date),\(compatible ? "YES" : "NO")\n"
|
||||||
return string
|
return string
|
||||||
}
|
}
|
||||||
|
|
||||||
func jsonString() throws -> String {
|
|
||||||
let data: Data = try JSONSerialization.data(withJSONObject: self, options: [.prettyPrinted, .sortedKeys])
|
|
||||||
return String(data: data, encoding: .utf8) ?? ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func propertyListString() throws -> String {
|
|
||||||
let data: Data = try PropertyListSerialization.data(fromPropertyList: self, format: .xml, options: .bitWidth)
|
|
||||||
return String(data: data, encoding: .utf8) ?? ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func yamlString() throws -> String {
|
|
||||||
try Yams.dump(object: self)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
//
|
|
||||||
// FileCompressor.swift
|
|
||||||
// Mist
|
|
||||||
//
|
|
||||||
// Created by Nindi Gill on 22/6/2022.
|
|
||||||
//
|
|
||||||
|
|
||||||
import Foundation
|
|
||||||
|
|
||||||
/// Helper struct to create Zip archives.
|
|
||||||
struct FileCompressor {
|
|
||||||
|
|
||||||
/// Compress a file or the contents of a directory.
|
|
||||||
///
|
|
||||||
/// - Parameters:
|
|
||||||
/// - url: The URL of the file or directory to be compressed.
|
|
||||||
/// - destination: The URL of the Zip file to be created.
|
|
||||||
///
|
|
||||||
/// - Throws: An `Error` if the command failed to execute.
|
|
||||||
static func compress(_ url: URL, to destination: URL) async throws {
|
|
||||||
try await DirectoryRemover.remove(destination)
|
|
||||||
|
|
||||||
let arguments: [String] = ["ditto", "-c", "-k", "--keepParent", "--sequesterRsrc", "--zlibCompressionLevel", "0", url.path, destination.path]
|
|
||||||
let result: (terminationStatus: Int32, standardOutput: String?, standardError: String?) = try ShellExecutor.shared.execute(arguments)
|
|
||||||
|
|
||||||
guard result.terminationStatus == 0 else {
|
|
||||||
throw MistError.invalidTerminationStatus(status: result.terminationStatus, string: result.standardError)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
//
|
|
||||||
// FileCreator.swift
|
|
||||||
// Mist
|
|
||||||
//
|
|
||||||
// Created by Nindi Gill on 22/6/2022.
|
|
||||||
//
|
|
||||||
|
|
||||||
import Foundation
|
|
||||||
|
|
||||||
/// Helper struct to create files with textual content.
|
|
||||||
struct FileCreator {
|
|
||||||
|
|
||||||
/// Create a file with the provided string and POSIX permissions.
|
|
||||||
///
|
|
||||||
/// - Parameters:
|
|
||||||
/// - url: The URL of the file to create.
|
|
||||||
/// - contents: The string to write to disk.
|
|
||||||
/// - permissions: The POSIX permissions to apply to the file being created.
|
|
||||||
///
|
|
||||||
/// - Throws: An `Error` if the command failed to execute.
|
|
||||||
static func create(_ url: URL, contents: String, permissions: Int) async throws {
|
|
||||||
try await DirectoryRemover.remove(url)
|
|
||||||
try contents.write(to: url, atomically: true, encoding: .utf8)
|
|
||||||
try FileManager.default.setAttributes([.posixPermissions: permissions], ofItemAtPath: url.path)
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -10,35 +10,6 @@ import Foundation
|
||||||
/// Helper struct to create macOS Installer Packages.
|
/// Helper struct to create macOS Installer Packages.
|
||||||
struct PackageCreator {
|
struct PackageCreator {
|
||||||
|
|
||||||
/// Create a macOS Installer Package with a custom root directory and scripts.
|
|
||||||
///
|
|
||||||
/// - Parameters:
|
|
||||||
/// - url: The URL of the Package to be created.
|
|
||||||
/// - installer: The `Installer` struct containing metadata of the macOS Installer.
|
|
||||||
/// - identifier: The package identifier.
|
|
||||||
/// - root: The URL of the package root directory.
|
|
||||||
/// - scripts: The URL of the package scripts directory.
|
|
||||||
/// - identity: Optional Codesigning identity used to sign the package.
|
|
||||||
///
|
|
||||||
/// - Throws: An `Error` if the command failed to execute.
|
|
||||||
static func create(_ url: URL, from installer: Installer, identifier: String, root: URL, scripts: URL, identity: String? = nil) async throws {
|
|
||||||
var arguments: [String] = [
|
|
||||||
"pkgbuild",
|
|
||||||
"--identifier", identifier,
|
|
||||||
"--version", installer.version,
|
|
||||||
"--root", root.path,
|
|
||||||
"--scripts", scripts.path,
|
|
||||||
"--install-location", "\(String.temporaryDirectory)/\(installer.id)"
|
|
||||||
]
|
|
||||||
|
|
||||||
if let identity: String = identity {
|
|
||||||
arguments.append(contentsOf: ["--sign", identity])
|
|
||||||
}
|
|
||||||
|
|
||||||
arguments.append(url.path)
|
|
||||||
try await create(url, with: arguments)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Create a macOS Installer Package based off the passed in `Installer` struct.
|
/// Create a macOS Installer Package based off the passed in `Installer` struct.
|
||||||
///
|
///
|
||||||
/// - Parameters:
|
/// - Parameters:
|
||||||
|
|
|
@ -13,8 +13,6 @@ struct DownloadView: View {
|
||||||
@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate: AppDelegate
|
@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate: AppDelegate
|
||||||
@Environment(\.presentationMode) var presentationMode: Binding<PresentationMode>
|
@Environment(\.presentationMode) var presentationMode: Binding<PresentationMode>
|
||||||
@AppStorage("enableNotifications") private var enableNotifications: Bool = false
|
@AppStorage("enableNotifications") private var enableNotifications: Bool = false
|
||||||
@AppStorage("retries") private var retries: Int = 10
|
|
||||||
@AppStorage("retryDelay") private var retryDelay: Int = 30
|
|
||||||
var downloadType: DownloadType
|
var downloadType: DownloadType
|
||||||
var imageName: String
|
var imageName: String
|
||||||
var name: String
|
var name: String
|
||||||
|
|
|
@ -14,7 +14,6 @@ struct RefreshView: View {
|
||||||
@Binding var installers: [Installer]
|
@Binding var installers: [Installer]
|
||||||
@State private var firmwaresState: RefreshState = .pending
|
@State private var firmwaresState: RefreshState = .pending
|
||||||
@State private var installersState: RefreshState = .pending
|
@State private var installersState: RefreshState = .pending
|
||||||
private let length: CGFloat = 18
|
|
||||||
private let width: CGFloat = 200
|
private let width: CGFloat = 200
|
||||||
private let height: CGFloat = 200
|
private let height: CGFloat = 200
|
||||||
private var buttonText: String {
|
private var buttonText: String {
|
||||||
|
|
|
@ -26,7 +26,6 @@ struct SettingsGeneralView: View {
|
||||||
private let enableAutomaticChecksDefault: Bool = true
|
private let enableAutomaticChecksDefault: Bool = true
|
||||||
private let scheduledCheckIntervalDefault: Int = 86_400
|
private let scheduledCheckIntervalDefault: Int = 86_400
|
||||||
private let width: CGFloat = 150
|
private let width: CGFloat = 150
|
||||||
private let length: CGFloat = 24
|
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue