Compare commits

..

5 Commits

Author SHA1 Message Date
Max Howell
f062ed9ce3 Fix CI deploy 2020-01-24 12:01:34 -05:00
Max Howell
f1f7ee33b1 [ci skip] List all support Swift 2020-01-24 11:17:42 -05:00
Max Howell
694d04f18b Prepare 1.0.0 release 2020-01-24 11:03:07 -05:00
Max Howell
5636a7ac65 Update Swift Linux test versions 2020-01-18 12:10:32 -05:00
Max Howell
3e964833ff Fix README documentation for Finder 2020-01-18 12:10:32 -05:00
7 changed files with 43 additions and 30 deletions

View File

@@ -1,10 +1,14 @@
# only run for: merge commits, releases and pull-requests
if: type != push OR branch = master OR branch =~ /^\d+\.\d+\.\d+(-.*)?$/
if: type != push OR branch = master OR branch =~ /^deploy-\d+\.\d+\.\d+(-.*)?$/ OR branch =~ /^\d+\.\d+\.\d+(-.*)?$/
stages:
- name: pretest
if: NOT branch =~ /^deploy-\d+\.\d+\.\d+(-.*)?$/
- name: test
if: NOT branch =~ /^deploy-\d+\.\d+\.\d+(-.*)?$/
- name: deploy
if: branch =~ /^deploy-\d+\.\d+\.\d+(-.*)?$/
- name: publish
if: branch =~ /^\d+\.\d+\.\d+(-.*)?$/
os: osx
@@ -64,12 +68,16 @@ jobs:
script: swift test --parallel
- <<: *linux
env: SWIFT_VERSION='5.0.2'
name: Linux / Swift 5.0.2
env: SWIFT_VERSION=5.0.3
name: Linux / Swift 5.0.3
- <<: *linux
env: SWIFT_VERSION=5.1-DEVELOPMENT-SNAPSHOT-2019-07-03-a
name: Linux / Swift 5.1 (2019-07-03)
env: SWIFT_VERSION=5.1.3
name: Linux / Swift 5.1.3
- <<: *linux
env: SWIFT_VERSION=5.2-DEVELOPMENT-SNAPSHOT-2020-01-22-a
name: Linux / Swift 5.2.0-dev+2020-01-22-a
- stage: pretest
name: Check Linux tests are syncd
@@ -78,6 +86,21 @@ jobs:
osx_image: xcode10.2
- stage: deploy
name: Deploy
osx_image: xcode11
env: HOMEBREW_NO_INSTALL_CLEANUP=1
install: brew install mxcl/made/swift-sh
script:
- set -e
- export VERSION=$(echo $TRAVIS_TAG | cut -c 8-)
- git tag "$VERSION"
- git remote set-url origin "https://$GITHUB_TOKEN@github.com/$TRAVIS_REPO_SLUG.git"
- git fetch --unshallow origin
- git push origin "$VERSION"
- swift sh <(curl https://raw.githubusercontent.com/mxcl/ops/master/deploy) publish-release
- git push origin :$TRAVIS_TAG
- stage: publish
name: Jazzy
osx_image: xcode10.2
install: gem install jazzy

View File

@@ -44,10 +44,8 @@ Swift), we provide a thoughtful and comprehensive (yet concise) API.
# Support mxcl
Hi, Im Max Howell and I have written a lot of open source software, and
probably you already use some of it (Homebrew anyone?). I work full-time on
open source and its hard; currently I earn *less* than minimum wage. Please
help me continue my work, I appreciate it x
Hi, Im Max Howell and I have written a lot of open source software—generally
a good deal of my free time 👨🏻‍💻.
<a href="https://www.patreon.com/mxcl">
<img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="160">
@@ -183,7 +181,7 @@ Path.home.find().execute { path in
Which is configurable:
```swift
Path.home.find().maxDepth(1).extension("swift").kind(.file) { path in
Path.home.find().depth(max: 1).extension("swift").type(.file) { path in
//
}
```
@@ -300,7 +298,7 @@ for that as the check was deemed too expensive to be worthwhile.
If a `Path` is a symlink but the destination of the link does not exist `exists`
returns `false`. This seems to be the correct thing to do since symlinks are
meant to be an abstraction for filesystems. To instead verify that there is
no filesystem entry there at all check if `kind` is `nil`.
no filesystem entry there at all check if `type` is `nil`.
## We do not provide change directory functionality
@@ -337,28 +335,19 @@ actual filesystem path, however we also check the URL has a `file` scheme first.
SwiftPM:
```swift
package.append(.package(url: "https://github.com/mxcl/Path.swift.git", from: "0.13.0"))
package.append(.package(url: "https://github.com/mxcl/Path.swift.git", from: "1.0.0"))
```
CocoaPods:
```ruby
pod 'Path.swift', '~> 0.13'
pod 'Path.swift', '~> 1.0.0'
```
Carthage:
> Waiting on: [@Carthage#1945](https://github.com/Carthage/Carthage/pull/1945).
## Pre1.0 status
We are pre 1.0, thus we can change the API as we like, and we will (to the
pursuit of getting it *right*)! We will tag 1.0 as soon as possible.
### Get push notifications for new releases
https://mxcl.dev/canopy/
# Alternatives
* [Pathos](https://github.com/dduan/Pathos) by Daniel Duan
@@ -368,7 +357,7 @@ https://mxcl.dev/canopy/
[badge-platforms]: https://img.shields.io/badge/platforms-macOS%20%7C%20Linux%20%7C%20iOS%20%7C%20tvOS%20%7C%20watchOS-lightgrey.svg
[badge-languages]: https://img.shields.io/badge/swift-4.2%20%7C%205.0-orange.svg
[badge-languages]: https://img.shields.io/badge/swift-4.2%20%7C%205.0%20%7C%205.1%20%7C%205.2-orange.svg
[docs]: https://mxcl.dev/Path.swift/Structs/Path.html
[badge-jazzy]: https://raw.githubusercontent.com/mxcl/Path.swift/gh-pages/badge.svg?sanitize=true
[badge-codecov]: https://codecov.io/gh/mxcl/Path.swift/branch/master/graph/badge.svg

View File

@@ -29,7 +29,7 @@ public extension Pathish {
if overwrite, let tokind = to.type, tokind != .directory, type != .directory {
try FileManager.default.removeItem(at: to.url)
}
#if os(Linux) && !swift(>=5.2) // check if fixed
#if os(Linux) && !swift(>=5.3) // check if fixed
if !overwrite, to.type != nil {
throw CocoaError.error(.fileWriteFileExists)
}
@@ -69,7 +69,7 @@ public extension Pathish {
if overwrite, let kind = rv.type, kind != .directory {
try FileManager.default.removeItem(at: rv.url)
}
#if os(Linux) && !swift(>=5.2) // check if fixed
#if os(Linux) && !swift(>=5.3) // check if fixed
if !overwrite, rv.type != nil {
throw CocoaError.error(.fileWriteFileExists)
}
@@ -204,7 +204,7 @@ public extension Pathish {
}
/**
Renames the file at path.
Renames the file (basename only) at path.
Path.root.foo.bar.rename(to: "baz") // => /foo/baz

View File

@@ -11,7 +11,8 @@ public extension Pathish {
/**
- Returns: `true` if the path represents an actual filesystem entry.
- Note: If `self` is a symlink the return value represents the destination.
- Note: If `self` is a symlink the return value represents the destination, thus if the destination doesnt exist this returns `false` even if the symlink exists.
- Note: To determine if a symlink exists, use `.type`.
*/
var exists: Bool {
return FileManager.default.fileExists(atPath: string)

View File

@@ -176,7 +176,7 @@ public extension Pathish {
Returns the filename extension of this path.
- Remark: If there is no extension returns "".
- Remark: If the filename ends with any number of ".", returns "".
- Note: We special case eg. `foo.tar.gz`.
- Note: We special case eg. `foo.tar.gz`there are a limited number of these specializations, feel free to PR more.
*/
@inlinable
var `extension`: String {

View File

@@ -66,7 +66,7 @@ extension PathTests {
}
}
func testFindKinds() throws {
func testFindTypes() throws {
try Path.mktemp { tmpdir in
try tmpdir.foo.mkdir()
try tmpdir.bar.touch()

View File

@@ -25,9 +25,9 @@ extension PathTests {
("testFileReference", testFileReference),
("testFilesystemAttributes", testFilesystemAttributes),
("testFindExtension", testFindExtension),
("testFindKinds", testFindKinds),
("testFindMaxDepth1", testFindMaxDepth1),
("testFindMaxDepth2", testFindMaxDepth2),
("testFindTypes", testFindTypes),
("testFlatMap", testFlatMap),
("testInitializerForRelativePath", testInitializerForRelativePath),
("testIsDirectory", testIsDirectory),