Swiftpack.co - pelagornis/plcommand as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by pelagornis.
pelagornis/plcommand 1.2.1
Running Command with Swift
⭐️ 2
🕓 1 week ago
macOS
.package(url: "https://github.com/pelagornis/plcommand.git", from: "1.2.1")

PLCommand

Official SPM Swift License Platform

⌘ Running Command from Swift

Installation

PLCommand was deployed as Swift Package Manager. Package to install in a project. Add as a dependent item within the swift manifest.

let package = Package(
    ...
    dependencies: [
        .package(url: "https://github.com/pelagornis/plcommand.git", from: "1.2.0")
    ],
    ...
)

Then import the PLCommand from thr location you want to use.

import Command

Documentation

The documentation for releases and main are available here:

Using

If you want to use Bash.

@Command(\.bash) var bashCommand
bashCommand.run("command")

Or if you want to use zsh.

@Command(\.zsh) var zshCommand
zshCommand.run("command")

Frequently Used Commands

PLCommand supports frequently used features.

Support Git Command

@Command(\.git) var git

git.`init`()
git.add()
git.clone(repositoryURL)
git.commit("comment")
git.push()
git.pull(remote: "origin")
git.checkout(branch: "gh-page")

Support Swift Package Command

@Command(\.package) var swiftPackage

swiftPackage.create()
swiftPackage.create(type: .executable)
swiftPackage.update()
swiftPackage.generateXcodeproj()
swiftPackage.build()
swiftPackage.test()

Extension

PLCommand is easier to scale.

extension CommandValues {
    var swift: Alias {
        Alias(executableURL: "/usr/bin/swift")
    }
}


// Usage
@Command(\.swift) var swiftCommand

License

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

GitHub

link
Stars: 2
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

PLCommand v1.2.1
1 week ago

What's Changed

Change the style of the previously supported command (Git, Swift Package) and support it again.

Support Git Command

@Command(\.git) var git

git.`init`()
git.add()
git.clone(repositoryURL)
git.commit("comment")
git.push()
git.pull(remote: "origin")
git.checkout(branch: "gh-page")

Support Swift Package Command

@Command(\.package) var swiftPackage

swiftPackage.create()
swiftPackage.create(type: .executable)
swiftPackage.update()
swiftPackage.generateXcodeproj()
swiftPackage.build()
swiftPackage.test()

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics