Swiftpack.co - yutailang0119/FileScanKit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by yutailang0119.
yutailang0119/FileScanKit 0.1.0
Scanning file path library for Swift
⭐️ 12
🕓 2 years ago
.package(url: "https://github.com/yutailang0119/FileScanKit.git", from: "0.1.0")

FileScanKit

Swift 5.3 Swift Package Manager Lincense

Overview

Scanning file path library for Swift.

Main use case is to be used with SwiftSyntax.

Support

  • Recursion
    • all
    • depth limit
  • FIle extension
  • Ignore paths

Note: FileScanKit is still in development, and the API is not guaranteed to be stable. It's subject to change without warning.

Requirements

  • Swift 5.3+
  • Xcode 12.4+

Installation

Swift Package Manager

// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "test",
    dependencies: [
        .package(url: "https://github.com/yutailang0119/FileScanKit.git", from: Version(0, 1, 0)),
    ],
    targets: [
        .target(name: "targetName", dependencies: ["FileScanKit"]),
    ]
)

https://github.com/apple/swift-package-manager

Usage

import Foundation
import FileScanKit

let path: String = "target/path"
guard let fileScanner = FileScanner(path: path)!

let recursion: Recursion = .all
let fileExtension: FileExtension = .swift
let ignorePaths: [String] = ["ignore/path"]
let option = Option(
    recursion: recursion,
    fileExtension: fileExtension,
    ignorePaths: ignorePaths
)

let result: Result<[URL], Error> = fileScanner.scan(with: option)

switch result {
case .success(let urls):
    // Do something
case .failure(let error):
    // Handle error
}

Author

Yutaro Muta

License

FileScanKit is available under the MIT license. See the LICENSE file for more info.
This software includes the work that is distributed in the BSD License.

GitHub

link
Stars: 12
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Dependencies

Release Notes

0.1.0
5 years ago

First Release 🎉

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