diff --git a/Sources/BinaryDependencyManager/Utils/BinaryDependenciesDownloader.swift b/Sources/BinaryDependencyManager/Utils/BinaryDependenciesDownloader.swift index f538cf3..29bdce0 100644 --- a/Sources/BinaryDependencyManager/Utils/BinaryDependenciesDownloader.swift +++ b/Sources/BinaryDependencyManager/Utils/BinaryDependenciesDownloader.swift @@ -1,18 +1,7 @@ -/// A protocol for downloading binary dependencies from git repositories. -protocol BinaryDependenciesDownloader { - /// Downloads the source code as a zip archive from the specified repo and release tag. - /// - /// - Parameters: - /// - repo: Git repository, e.g. "owner/repo". - /// - tag: The release tag to download. - /// - outputFilePath: The output file path for the downloaded archive. - /// - Throws: If the download fails. - func downloadSourceCode( - repo: String, - tag: String, - outputFilePath: String - ) throws +import Utils +/// A protocol for downloading binary dependencies from git repositories. +public protocol BinaryDependenciesDownloader { /// Downloads a specific release asset from git repo matching the provided pattern. /// /// - Parameters: diff --git a/Sources/Utils/CLI/CLI+GitHub.swift b/Sources/Utils/CLI/CLI+GitHub.swift index 6d43cd0..a866c5e 100644 --- a/Sources/Utils/CLI/CLI+GitHub.swift +++ b/Sources/Utils/CLI/CLI+GitHub.swift @@ -33,35 +33,6 @@ extension CLI.GitHub { ) } - /// Downloads the source code as a zip archive from the specified repo and release tag using `gh`. - /// - /// - Parameters: - /// - repo: GitHub repository, e.g. "owner/repo". - /// - tag: The release tag to download. - /// - outputFilePath: The output file path for the downloaded archive. - /// - Throws: If the download fails. - public func downloadSourceCode( - repo: String, - tag: String, - outputFilePath: String - ) throws { - let arguments: [String] = [ - ["release"], - ["download"], - ["\(tag)"], - ["--archive=zip"], - ["--repo", "\(repo)"], - ["--output", "\(outputFilePath)"] - ].flatMap { $0 } - - Logger.log("[Download] ⬇️ \(repo) source code with tag \(tag) to \(outputFilePath)") - - try run( - arguments: arguments, - currentDirectoryURL: outputFilePath.asFileURL.deletingLastPathComponent() - ) - } - /// Downloads a specific release asset from GitHub matching the provided pattern using `gh`. /// /// - Parameters: