GitXplorerGitXplorer
h

Shell

public
109 stars
7 forks
0 issues

Commits

List of commits on branch master.
Verified
ecf028f2a1a9786836cd1f6d8718d7844bce47b0

Use proper triple dots

hhelje5 committed 2 years ago
Unverified
fa412d11e196bb299f48f2c2a1ebed78d05bd29d

Typo and indent-4

hhelje5 committed 4 years ago
Verified
3a8c8e30c7f95ac1992283f800326f5c9351bb4b

Update README.md

hhelje5 committed 5 years ago
Unverified
aa6bf08ea32c512752050737534cf9ff0b64b14c

Cleanup Package.swift

hhelje5 committed 5 years ago
Unverified
59110cdcdba3606f9f6e7d8bad523e52e7d54e58

Travis: Build against 5.0 release

hhelje5 committed 5 years ago
Unverified
5e688bc364d6f4c706eb4cd43c43bc41f9e37c63

Travis: Add a basic Travis compile test

hhelje5 committed 6 years ago

README

The README file for this repository.

Shell

Swift5 macOS

Module exposing Unix command line tools as Swift 5 @dynamicCallable functions

A few words of warning: This is intended as a demo. It should work just fine, but in the name of error handling and proper Swift beauty, you might want to approach forking processes differently 🤓 (BTW: PRs are welcome!)

Part of this blog post: @dynamicCallable: Unix Tools as Swift Functions.

Sample tool

The regular Swift Package Manager setup process:

mkdir ShellConsumerTest && cd ShellConsumerTest
swift package init --type executable

Sample main.swift:

import Shell

print(shell.host("zeezide.de"))

Sample Package.swift:

// swift-tools-version:5.0

import PackageDescription

let package = Package(
    name: "ShellConsumerTest",
    dependencies: [
        .package(url: "https://github.com/AlwaysRightInstitute/Shell.git",
                 from: "0.1.0"),
    ],
    targets: [
        .target(name: "ShellConsumerTest", dependencies: [ "Shell" ]),
    ]
)

Remember to add the dependency in two places. WET is best!

swift run and swift test patch the $PATH to just /usr/bin. You may want to run the binary directly to make lookup work properly.

For this to work, you need to have Swift 5+ installed.

Links

Who

Brought to you by ZeeZide. We like feedback, GitHub stars, cool contract work, presumably any form of praise you can think of.