Fix running command from Terminal
Running from the terminal would fail with a `missingValue(argument: Optional("BUILD_ROOT"))` error. Even when the `-i` CLI parameter was provided. This moves the fallback logic to only run when a fallback needs to be found.
This commit is contained in:
parent
cf7f944af4
commit
2a97232cb9
|
@ -26,14 +26,13 @@ fileprivate func main(_ arguments: [String]) -> Int32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func createConfiguration(options: CommandLineOptions) throws -> Configuration {
|
private func createConfiguration(options: CommandLineOptions) throws -> Configuration {
|
||||||
let processInfo = ProcessInfo()
|
|
||||||
/// Find the index path, default is ~Library/Developer/Xcode/DerivedData/<target>/Index/DataStore
|
|
||||||
let buildRoot = try processInfo.environmentVariable(name: EnvironmentKeys.buildRoot)
|
|
||||||
|
|
||||||
let indexStorePath: AbsolutePath
|
let indexStorePath: AbsolutePath
|
||||||
if let indexStorePathString = options.indexStorePath {
|
if let indexStorePathString = options.indexStorePath {
|
||||||
indexStorePath = AbsolutePath(indexStorePathString)
|
indexStorePath = AbsolutePath(indexStorePathString)
|
||||||
} else {
|
} else {
|
||||||
|
let processInfo = ProcessInfo()
|
||||||
|
// Find the index path, default is ~Library/Developer/Xcode/DerivedData/<target>/Index/DataStore
|
||||||
|
let buildRoot = try processInfo.environmentVariable(name: EnvironmentKeys.buildRoot)
|
||||||
let buildRootPath = AbsolutePath(buildRoot)
|
let buildRootPath = AbsolutePath(buildRoot)
|
||||||
indexStorePath = buildRootPath.parentDirectory.parentDirectory.appending(component: "Index/DataStore")
|
indexStorePath = buildRootPath.parentDirectory.parentDirectory.appending(component: "Index/DataStore")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue