⌘ Running Command from Swift
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.5")
],
...
)
Then import the PLCommand from thr location you want to use.
import Command
The documentation for releases and main
are available here:
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")
Or if you want to use Makefile command.
@Command(\.make) var makeCommand
makeCommand.run("command")
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()
Support Fastlane
Command
@Command(\.fastlane) var fastlane
fastlane.`init`()
fastlane.tests()
fastlane.snapshot()
fastlane.deliver()
fastlane.frameit()
fastlane.run("fastlane command")
Support Tuist
Command
@Command(\.tuist) var tuist
tuist.build()
tuist.clean()
tuist.fetch()
tuist.edit()
tuist.graph()
tuist.generate()
tuist.migration([])
tuist.scaffold("template", [])
tuist.test()
tuist.run("tuist command")
PLCommand is easier to scale.
extension CommandValues {
var swift: Alias {
Alias(executableURL: "/usr/bin/swift")
}
}
// Usage
@Command(\.swift) var swiftCommand
plcommand is under MIT license. See the LICENSE file for more info.