From 694d04f18b5d76c73662d09483305beee56d6ba5 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 24 Jan 2020 10:22:12 -0500 Subject: [PATCH] Prepare 1.0.0 release --- .travis.yml | 21 ++++++++++++++++++++- README.md | 19 ++++--------------- Sources/Path+FileManager.swift | 6 +++--- Sources/Path->Bool.swift | 3 ++- Sources/Path.swift | 2 +- 5 files changed, 30 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index f1e1067..c29b71f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,12 @@ # 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 - name: test - name: deploy + if: branch =~ /^deploy-\d+\.\d+\.\d+(-.*)?$/ + - name: publish if: branch =~ /^\d+\.\d+\.\d+(-.*)?$/ os: osx @@ -70,6 +72,10 @@ jobs: - <<: *linux 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 sync’d @@ -78,6 +84,19 @@ jobs: osx_image: xcode10.2 - stage: deploy + name: Deploy + osx_image: xcode11 + script: + - export VERSION=$(echo $TRAVIS_TAG | cut -c 8-) + - git tag "$VERSION" + - git remote set-url origin "https://$GITHUB_TOKEN@github.com/mxcl/homebrew-made.git" + - git push origin "$VERSION" + - curl -O https://raw.githubusercontent.com/mxcl/ops/master/deploy + - chmod u+x deploy + - ./deploy publish-release + - git push origin :$TRAVIS_TAG + + - stage: publish name: Jazzy osx_image: xcode10.2 install: gem install jazzy diff --git a/README.md b/README.md index 3781d66..5e8eb1a 100644 --- a/README.md +++ b/README.md @@ -44,10 +44,8 @@ Swift), we provide a thoughtful and comprehensive (yet concise) API. # Support mxcl -Hi, I’m 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 it’s hard; currently I earn *less* than minimum wage. Please -help me continue my work, I appreciate it x +Hi, I’m Max Howell and I have written a lot of open source software—generally +a good deal of my free time 👨🏻‍💻. @@ -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). -## Pre‐1.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 diff --git a/Sources/Path+FileManager.swift b/Sources/Path+FileManager.swift index 6d9d8c5..66edf22 100644 --- a/Sources/Path+FileManager.swift +++ b/Sources/Path+FileManager.swift @@ -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 diff --git a/Sources/Path->Bool.swift b/Sources/Path->Bool.swift index 87c2c11..31270bd 100644 --- a/Sources/Path->Bool.swift +++ b/Sources/Path->Bool.swift @@ -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 doesn’t 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) diff --git a/Sources/Path.swift b/Sources/Path.swift index e58c518..8842066 100644 --- a/Sources/Path.swift +++ b/Sources/Path.swift @@ -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 {