• Stars
    star
    1,453
  • Rank 32,372 (Top 0.7 %)
  • Language
    Swift
  • License
    BSD 2-Clause "Sim...
  • Created about 10 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Effortless path operations in Swift

PathKit

Build Status

Effortless path operations in Swift.

Usage

let path = Path("/usr/bin/swift")

Joining paths

let path = Path("/usr/bin") + Path("swift")

Determine if a path is absolute

path.isAbsolute

Determine if a path is relative

path.isRelative

Determine if a file or directory exists at the path

path.exists()

Determine if a path is a directory

path.isDirectory()

Get an absolute path

let absolutePath = path.absolute()

Normalize a path

This cleans up any redundant .. or . and double slashes in paths.

let normalizedPath = path.normalize()

Deleting a path

path.delete()

Moving a path

path.move(newPath)

Current working directory

Path.current
Path.current = "/usr/bin"

Changing the current working directory

path.chdir {
  // Path.current would be set to path during execution of this closure
}

Children paths

path.children()

Reading

path.read()

Writing

path.write("Hello World!")

Glob

let paths = Path.glob("*.swift")

Contact

Kyle Fuller

License

PathKit is licensed under the BSD License.

More Repositories

1

swiftenv

Swift Version Manager
Shell
1,979
star
2

Commander

Compose beautiful command line interfaces in Swift
Swift
1,530
star
3

Mockingjay

An elegant library for stubbing HTTP requests with ease in Swift
Swift
1,490
star
4

JSONWebToken.swift

Swift implementation of JSON Web Token (JWT).
Swift
763
star
5

Spectre

BDD Framework and test runner for Swift projects and playgrounds
Swift
403
star
6

JSONSchema.swift

JSON Schema validator in Swift
Swift
274
star
7

URITemplate.swift

Swift implementation of URI Template (RFC6570)
Swift
199
star
8

apiblueprint.vim

This vim plugin brings syntax highlighting and linting for API Blueprint.
Vim Script
113
star
9

dotfiles

kylef's dotfile
Vim Script
33
star
10

swiftenv-api

API for swiftenv to return the available versions of Swift
Python
25
star
11

draughtsman

API Blueprint Parser for Python 3
Python
23
star
12

changelog

A formal specification for changelog files and entries
18
star
13

goji

Command line JIRA client
Python
18
star
14

swiftenv-docker

This repository contains swiftenv images for Docker
Makefile
18
star
15

irctk

A Python IRC client library
Python
6
star
16

maintain

A unified interface to maintaining projects of any language.
Python
6
star
17

ucp

A simple and universal command line tool for capturing screenshots and uploading to the web.
Shell
5
star
18

redirector

Simple web server for HTTP redirecting from one domain to another.
Python
4
star
19

pygments-apiblueprint

An API Blueprint Lexer for Pygments
Python
3
star
20

refract.py

A Python library for interacting with Refract
Python
3
star
21

life

This repository is used as a personal issue tracker
2
star
22

homebrew-formulae

Ruby
1
star