TerminalKit 1.0.2

TerminalKit 1.0.2

Maintained by bugkingK.



  • By
  • bugkingK

TerminalKit

‘TerminalKit’ makes it easy to process scripts. ‘TerminalKit’ is a class using Process. The easy callback function allows you to process tasks when scripts are running and when they are complete.

Installation

CocoaPods:

pod 'TerminalKit'

Manual:

Copy TerminalKit.swift to your project.

Using TerminalKit

// When checking the script for completion only.
TerminalKit("ls -al").launch { (ter) in
    if let output = ter.output {
        print(output)
    }

    if let errput = ter.errput {
        print(errput)
    }

    print(ter.paragraph)
    print("end")
}

// When you want to track a script,
TerminalKit("ls -al").launch(onRunning: { ter in
    // When the script is working
}) { ter in
    // When the script is complete
}

// You want to run multiple scripts.
TerminalKit(["ls -al", "ls -al", "ls -al"]).launch { ter in
    // When the script is complete
}

License

TerminalKit is available under the MIT license. See the LICENSE file for more info.