mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Move library check to separate file in mac crafter
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
82c46b7539
commit
4e37ec8b4c
19
admin/osx/mac-crafter/Sources/Utils/Library.swift
Normal file
19
admin/osx/mac-crafter/Sources/Utils/Library.swift
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (C) 2024 by Claudio Cambra <claudio.cambra@nextcloud.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
|
||||
func isLibrary(_ path: String) -> Bool {
|
||||
path.hasSuffix(".dylib") || path.hasSuffix(".framework")
|
||||
}
|
||||
@ -73,9 +73,8 @@ struct MacCrafter: ParsableCommand {
|
||||
let craftLibDir = "\(currentDir)/\(craftTarget)/lib"
|
||||
let craftLibs = try fm.contentsOfDirectory(atPath: craftLibDir)
|
||||
for lib in craftLibs {
|
||||
let libPath = "\(craftLibDir)/\(lib)"
|
||||
guard lib.hasSuffix(".dylib") || lib.hasSuffix(".framework") else { continue }
|
||||
try codesign(identity: codeSignIdentity, path: libPath)
|
||||
guard isLibrary(lib) else { continue }
|
||||
try codesign(identity: codeSignIdentity, path: "\(craftLibDir)/\(lib)")
|
||||
}
|
||||
|
||||
let craftPluginsDir = "\(currentDir)/\(craftTarget)/plugins"
|
||||
@ -84,9 +83,8 @@ struct MacCrafter: ParsableCommand {
|
||||
}
|
||||
|
||||
for case let plugin as String in craftPluginsEnumerator {
|
||||
let pluginPath = "\(craftPluginsDir)/\(plugin)"
|
||||
guard plugin.hasSuffix(".dylib") || plugin.hasSuffix(".framework") else { continue }
|
||||
try codesign(identity: codeSignIdentity, path: pluginPath)
|
||||
guard isLibrary(plugin) else { continue }
|
||||
try codesign(identity: codeSignIdentity, path: "\(craftPluginsDir)/\(plugin)")
|
||||
}
|
||||
|
||||
print("Crafting Nextcloud Desktop Client...")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user