Swiftpack.co - klein-artur/GitCaller as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by klein-artur.
klein-artur/GitCaller v_1.0.5
A wrapper around git.
⭐️ 0
🕓 1 year ago
macOS
.package(url: "https://github.com/klein-artur/GitCaller.git", from: "v_1.0.5")

GitCaller

This is a swift package currently in development. It is meant as a git bridge for swift, using git through shell, returning the result. Do not consider this as done.

I try to release stable versions via the main branch, but it can be way behind the current state of development. So feel free to use the develop branch which will always have the newest state (but also issues and unclean states).

It is used by the project Jagu.

Integration as a Swift Package.

Integrate it using the url of this package shown in the browser.

How it works.

The idea is to have a nice api to run git commands For example:

  • git init will be Git().init
  • git clone url will be Git().clone(url: "[email protected]:klein-artur/GitParser.git")
  • git add -a will be Git().add.all()
  • git add filename will be Git().add.path("filename")

To get the command as string, call Git().init.getString().

To run the command you have two possibilities:

  • Git().init.run() will return a Combine Publisher emitting the output. If multiple outputs happen the current output will be emitted.
  • Git().init.runAsync() will return a async function you can await to get the final output.

Parsed Results

This lib will also give you complete objects holding data.

There is a protocol Repository. The default implementation is GitRepo

This repo implementation already has a few methods to get parsed objects. For example:

GitRepo.standard.clone(url: String) will clone a repo from the given URL. GitRepo.standard.log(branchName: String) will give you a LogResult holding commits, plus information how to draw a git path.

And more.

Woha!!! Slow Slow!

As this is under development at the moment just a few commands and parameters are supported. Feel free to add more by a PullRequest.

GitHub

link
Stars: 0
Last commit: 28 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

Alpha 0.1.8
29 weeks ago

Fit to Xcode 15

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