Skip to content

Commit fe82f78

Browse files
Rename 3 methods in URLManager
1 parent a9b36c1 commit fe82f78

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

Stellar/Sources/Core/Constants/Constants.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct GitHubAPI {
2626
static let tokenFile = ".GITHUB-TOKEN"
2727

2828
static var gitHubToken: String = {
29-
let tokenFileURL = URLManager().systemLocation()
29+
let tokenFileURL = URLManager().homeStellarLocation()
3030
.appendingPathComponent(GitHubAPI.tokenFile)
3131

3232
guard FileManager.default.fileExists(at: tokenFileURL) else {

Stellar/Sources/Core/Installer/CLIInstaller.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public final class CLIInstaller: CLIInstallerProtocol {
9494
throw ReleaseProviderErrors.releaseNotAvailable(version)
9595
}
9696

97-
let installURL = try urlManager.systemVersionLocation(version)
97+
let installURL = try urlManager.cliLocation(version)
9898

9999
try fileManager.withTemporaryDirectory(
100100
path: nil,

Stellar/Sources/Core/Providers/Support/LocalVersion.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public struct LocalVersion: Comparable, CustomStringConvertible {
1818
///
1919
/// - Parameter version: version to locate.
2020
init?(version: SemVer) throws {
21-
let folderPath = try URLManager().systemVersionLocation(version.description).path
21+
let folderPath = try URLManager().cliLocation(version.description).path
2222
var isDirectory = ObjCBool(false)
2323
guard FileManager.default.fileExists(atPath: folderPath, isDirectory: &isDirectory), isDirectory.boolValue else {
2424
return nil

Stellar/Sources/Core/Providers/VersionResolver.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public final class VersionResolver: VersionResolving {
7777
// MARK: - Public Functiosn
7878

7979
public func installedVersions() throws -> [LocalVersion] {
80-
try urlManager.systemVersionsLocation().glob("*").compactMap {
80+
try urlManager.cliVersionsLocation().glob("*").compactMap {
8181
LocalVersion(path: $0)
8282
}.sorted()
8383
}
@@ -87,7 +87,7 @@ public final class VersionResolver: VersionResolving {
8787
}
8888

8989
public func pathForVersion(_ version: String) throws -> URL? {
90-
try urlManager.systemVersionLocation(version)
90+
try urlManager.cliLocation(version)
9191
}
9292

9393
public func isVersionInstalled(_ version: String) throws -> Bool {

Stellar/Sources/Core/URLManager/URLManager.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ final class URLManager {
6565
///
6666
/// - Parameter subfolder: optional subfolder.
6767
/// - Returns: full path.
68-
func systemLocation(subfolder: String? = nil) -> URL {
68+
func homeStellarLocation(subfolder: String? = nil) -> URL {
6969
let homeStellarURL = fileManager
7070
.homeDirectoryForCurrentUser
7171
.appendingPathComponent(FolderConstants.dotStellarFolder)
@@ -79,8 +79,8 @@ final class URLManager {
7979
/// Return the location to the installed versions.
8080
///
8181
/// - Returns: a URL to the folder containing the installed versions
82-
func systemVersionsLocation() throws -> URL {
83-
let url = systemLocation(subfolder: FolderConstants.versionsFolder)
82+
func cliVersionsLocation() throws -> URL {
83+
let url = homeStellarLocation(subfolder: FolderConstants.versionsFolder)
8484
// not sure if we should create the folder
8585
if !fileManager.folderExists(at: url) {
8686
try fileManager.createFolder(at: url)
@@ -92,8 +92,8 @@ final class URLManager {
9292
///
9393
/// - Parameter version: version to get.
9494
/// - Returns: a URL to the installed version
95-
func systemVersionLocation(_ version: String) throws -> URL {
96-
let url = systemLocation(subfolder: FolderConstants.versionsFolder)
95+
func cliLocation(_ version: String) throws -> URL {
96+
let url = homeStellarLocation(subfolder: FolderConstants.versionsFolder)
9797
.appendingPathComponent(version)
9898
// not sure if we should create the folder
9999
if !fileManager.folderExists(at: url) {

0 commit comments

Comments
 (0)