Skip to content

MihaelIsaev/SwiftBash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIT License Swift 5.1 Swift.Stream


Support this lib by giving a ⭐️

Built for any swift project

How to install

Swift Package Manager

.package(url: "https://github.com/MihaelIsaev/SwiftBash.git", from:"1.0.0")

In your target's dependencies add "Bash" e.g. like this:

.target(name: "App", dependencies: [
    .product(name: "Bash", package: "SwiftBash")
]),

Usage

Which

import Bash

try {
    let pathToProgram = try bash.which("systemd")
} catch {
    if let error = error as? WhichError {
        switch error {
        case .notFound(let program):
            print("Program not found")
        }
    } else {
        print("Bash error: \(error)")
    }
}

Dependencies

Foundation only

Contributing

Please feel free to contribute!

About

Tiny little library which gives simple access to several bash commands

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages