Skip to content

Commit 2158e4e

Browse files
committed
Rename an argument and a constant
1 parent 1c91f8b commit 2158e4e

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

ReactiveTask/Task.swift

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -431,35 +431,35 @@ extension Signal where Value: TaskEventType {
431431
/// Launches a new shell task.
432432
///
433433
/// - Parameters:
434-
/// - taskDescription: The task to launch.
435-
/// - standardInput: Data to stream to standard input of the launched process. If nil, stdin will
436-
/// be inherited from the parent process.
434+
/// - task: The task to launch.
435+
/// - standardInput: Data to stream to standard input of the launched process. If nil, stdin will
436+
/// be inherited from the parent process.
437437
///
438438
/// - Returns: A producer that will launch the task when started, then send
439439
/// `TaskEvent`s as execution proceeds.
440-
public func launchTask(taskDescription: Task, standardInput: SignalProducer<NSData, NoError>? = nil) -> SignalProducer<TaskEvent<NSData>, TaskError> {
440+
public func launchTask(task: Task, standardInput: SignalProducer<NSData, NoError>? = nil) -> SignalProducer<TaskEvent<NSData>, TaskError> {
441441
return SignalProducer { observer, disposable in
442-
let queue = dispatch_queue_create(taskDescription.description, DISPATCH_QUEUE_SERIAL)
442+
let queue = dispatch_queue_create(task.description, DISPATCH_QUEUE_SERIAL)
443443
let group = Task.group
444444

445-
let task = NSTask()
446-
task.launchPath = taskDescription.launchPath
447-
task.arguments = taskDescription.arguments
445+
let rawTask = NSTask()
446+
rawTask.launchPath = task.launchPath
447+
rawTask.arguments = task.arguments
448448

449-
if let cwd = taskDescription.workingDirectoryPath {
450-
task.currentDirectoryPath = cwd
449+
if let cwd = task.workingDirectoryPath {
450+
rawTask.currentDirectoryPath = cwd
451451
}
452452

453-
if let env = taskDescription.environment {
454-
task.environment = env
453+
if let env = task.environment {
454+
rawTask.environment = env
455455
}
456456

457457
var stdinProducer: SignalProducer<(), TaskError> = .empty
458458

459459
if let input = standardInput {
460460
switch Pipe.create(queue, group) {
461461
case let .Success(pipe):
462-
task.standardInput = pipe.readHandle
462+
rawTask.standardInput = pipe.readHandle
463463

464464
stdinProducer = pipe.writeDataFromProducer(input).on(started: {
465465
close(pipe.readFD)
@@ -518,11 +518,11 @@ public func launchTask(taskDescription: Task, standardInput: SignalProducer<NSDa
518518
))
519519
}
520520

521-
task.standardOutput = stdoutPipe.writeHandle
522-
task.standardError = stderrPipe.writeHandle
521+
rawTask.standardOutput = stdoutPipe.writeHandle
522+
rawTask.standardError = stderrPipe.writeHandle
523523

524524
dispatch_group_enter(group)
525-
task.terminationHandler = { task in
525+
rawTask.terminationHandler = { task in
526526
let terminationStatus = task.terminationStatus
527527
if terminationStatus == EXIT_SUCCESS {
528528
// Wait for stderr to finish, then pass
@@ -545,18 +545,18 @@ public func launchTask(taskDescription: Task, standardInput: SignalProducer<NSDa
545545
dispatch_group_leave(group)
546546
}
547547

548-
task.launch()
548+
rawTask.launch()
549549
close(stdoutPipe.writeFD)
550550
close(stderrPipe.writeFD)
551551

552-
observer.sendNext(.Launch(taskDescription))
552+
observer.sendNext(.Launch(task))
553553

554554
stdinProducer.startWithSignal { signal, signalDisposable in
555555
disposable += signalDisposable
556556
}
557557

558558
disposable.addDisposable {
559-
task.terminate()
559+
rawTask.terminate()
560560
}
561561
}
562562
}

0 commit comments

Comments
 (0)