Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mihaelisaev/swiftbash
Tiny little library which gives simple access to several bash commands
https://github.com/mihaelisaev/swiftbash
Last synced: 6 days ago
JSON representation
Tiny little library which gives simple access to several bash commands
- Host: GitHub
- URL: https://github.com/mihaelisaev/swiftbash
- Owner: MihaelIsaev
- License: mit
- Created: 2024-10-10T12:12:10.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2024-10-10T12:43:59.000Z (4 months ago)
- Last Synced: 2025-02-01T10:16:32.467Z (10 days ago)
- Language: Swift
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#### Support this lib by giving a ⭐️
Built for any swift project
## How to install
### Swift Package Manager
```swift
.package(url: "https://github.com/MihaelIsaev/SwiftBash.git", from:"1.0.0")
```
In your target's dependencies add `"Bash"` e.g. like this:
```swift
.target(name: "App", dependencies: [
.product(name: "Bash", package: "SwiftBash")
]),
```## Usage
### Which
```swift
import Bashtry {
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!