Skip to content

Commit

Permalink
Applying PR recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
Serghei Moret committed Oct 23, 2017
1 parent 15337fe commit 2286a26
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,9 @@ class InspectorViewController: NSViewController, NSTableViewDataSource {
if let launchPath = Constants.FilePaths.Bash.startDevice {
let outputStream = CommandsCore.CommandTextOutputStream()
outputStream.textHandler = { text in
if !text.isEmpty {
DispatchQueue.main.async {
self.textViewPrinter.printToTextView(text)
}
guard !text.isEmpty else { return }
DispatchQueue.main.async {
self.textViewPrinter.printToTextView(text)
}
}
var arguments: [String] = []
Expand Down
15 changes: 7 additions & 8 deletions Launcher/Classes/ViewControllers/TasksViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class TasksViewController: NSViewController {
@objc dynamic var isRunning = false
let applicationStateHandler = ApplicationStateHandler()
let tagsController = TagsController()
var devices: [String] = [""]
var devices = [""]
var timer: Timer!
var pathToCalabashFolder = ""

Expand Down Expand Up @@ -152,7 +152,7 @@ class TasksViewController: NSViewController {
}

func killProcessScreenshot() {
commands.executeCommand(at: Constants.FilePaths.Bash.killProcess ?? "", arguments: [""])
commands.executeCommand(at: Constants.FilePaths.Bash.killProcess ?? "", arguments: [])
}

@IBAction func buildPicker(_ sender: Any) {
Expand Down Expand Up @@ -307,10 +307,9 @@ class TasksViewController: NSViewController {
if let launchPath = Constants.FilePaths.Bash.sendToIRB {
let outputStream = CommandsCore.CommandTextOutputStream()
outputStream.textHandler = { text in
if !text.isEmpty {
DispatchQueue.main.async {
self.textViewPrinter.printToTextView(text)
}
guard !text.isEmpty else { return }
DispatchQueue.main.async {
self.textViewPrinter.printToTextView(text)
}
}
let arguments = [self.textField.stringValue]
Expand Down Expand Up @@ -391,7 +390,7 @@ class TasksViewController: NSViewController {
self.phoneComboBox.addItems(withTitles: filderedText)
}
}
commands.executeCommand(at: launchPath, arguments: [""], outputStream: outputStream)
commands.executeCommand(at: launchPath, arguments: [], outputStream: outputStream)
}

buildButton.isEnabled = true
Expand All @@ -402,7 +401,7 @@ class TasksViewController: NSViewController {
}

func killIrbSession() {
commands.executeCommand(at: Constants.FilePaths.Bash.quitIRBSession ?? "", arguments: [""])
commands.executeCommand(at: Constants.FilePaths.Bash.quitIRBSession ?? "", arguments: [])
}

func statePreservation() {
Expand Down

0 comments on commit 2286a26

Please sign in to comment.