Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3333c731d3 | ||
|
|
e15173cfbc | ||
|
|
7be264a38e |
39
.travis.yml
39
.travis.yml
@@ -52,9 +52,9 @@ jobs:
|
|||||||
- stage: deploy
|
- stage: deploy
|
||||||
name: Jazzy
|
name: Jazzy
|
||||||
before_install: |
|
before_install: |
|
||||||
cat << EOF > .jazzy.yaml
|
cat <<\ \ EOF> .jazzy.yaml
|
||||||
module: Path
|
module: Path
|
||||||
module_version: $TRAVIS_TAG
|
module_version: TRAVIS_TAG
|
||||||
custom_categories:
|
custom_categories:
|
||||||
- name: Path
|
- name: Path
|
||||||
children:
|
children:
|
||||||
@@ -65,12 +65,13 @@ jobs:
|
|||||||
output: output
|
output: output
|
||||||
github_url: https://github.com/mxcl/Path.swift
|
github_url: https://github.com/mxcl/Path.swift
|
||||||
EOF
|
EOF
|
||||||
install: |
|
sed -i '' "s/TRAVIS_TAG/$TRAVIS_TAG/" .jazzy.yaml
|
||||||
gem install jazzy
|
# ^^ this weirdness because Travis multiline YAML is broken and inserts two
|
||||||
swift package generate-xcodeproj
|
# spaces in front of the output which means we need a prefixed delimiter which
|
||||||
script: |
|
# also weirdly stops bash from doing variable substitution
|
||||||
jazzy
|
install: gem install jazzy
|
||||||
rm -rf output/docsets
|
before_script: swift package generate-xcodeproj
|
||||||
|
script: jazzy
|
||||||
deploy:
|
deploy:
|
||||||
provider: pages
|
provider: pages
|
||||||
skip-cleanup: true
|
skip-cleanup: true
|
||||||
@@ -81,23 +82,25 @@ jobs:
|
|||||||
|
|
||||||
- name: CocoaPods
|
- name: CocoaPods
|
||||||
before_install: |
|
before_install: |
|
||||||
cat << EOF > Path.swift.podspec
|
cat <<\ \ EOF> Path.swift.podspec
|
||||||
Pod::Spec.new do |s|
|
Pod::Spec.new do |s|
|
||||||
s.name = 'Path.swift'
|
s.name = 'Path.swift'
|
||||||
s.version = '$TRAVIS_TAG'
|
s.version = 'TRAVIS_TAG'
|
||||||
s.summary = 'Delightful, robust file-pathing functions'
|
s.summary = 'Delightful, robust file-pathing functions'
|
||||||
s.homepage = 'https://github.com/mxcl/Path.swift'
|
s.homepage = 'https://github.com/mxcl/Path.swift'
|
||||||
s.license = { :type => 'Unlicense', :file => 'LICENSE.md' }
|
s.license = { :type => 'Unlicense', :file => 'LICENSE.md' }
|
||||||
s.author = { 'mxcl' => 'mxcl@me.com' }
|
s.author = { 'mxcl' => 'mxcl@me.com' }
|
||||||
s.source = { :git => 'https://github.com/mxcl/Path.swift.git', :tag => s.version.to_s }
|
s.source = { :git => 'https://github.com/mxcl/Path.swift.git', :tag => s.version.to_s }
|
||||||
s.social_media_url = 'https://twitter.com/mxcl'
|
s.social_media_url = 'https://twitter.com/mxcl'
|
||||||
s.osx.deployment_target = '10.10'
|
s.osx.deployment_target = '10.10'
|
||||||
s.ios.deployment_target = '8.0'
|
s.ios.deployment_target = '8.0'
|
||||||
s.tvos.deployment_target = '10.0'
|
s.tvos.deployment_target = '10.0'
|
||||||
s.watchos.deployment_target = '3.0'
|
s.watchos.deployment_target = '3.0'
|
||||||
s.source_files = 'Sources/*'
|
s.source_files = 'Sources/*'
|
||||||
s.swift_version = "4.2"
|
s.swift_version = '4.2'
|
||||||
end
|
end
|
||||||
EOF
|
EOF
|
||||||
|
sed -i '' "s/TRAVIS_TAG/$TRAVIS_TAG/" Path.swift.podspec
|
||||||
|
# ^^ see the Jazzy deployment for explanation
|
||||||
install: gem install cocoapods --pre
|
install: gem install cocoapods --pre
|
||||||
script: pod trunk push --allow-warnings
|
script: pod trunk push
|
||||||
|
|||||||
@@ -5,6 +5,16 @@ public extension Path {
|
|||||||
var isWritable: Bool {
|
var isWritable: Bool {
|
||||||
return FileManager.default.isWritableFile(atPath: string)
|
return FileManager.default.isWritableFile(atPath: string)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns true if the path represents an actual file that is also readable by the current user.
|
||||||
|
var isReadable: Bool {
|
||||||
|
return FileManager.default.isReadableFile(atPath: string)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns true if the path represents an actual file that is also deletable by the current user.
|
||||||
|
var isDeletable: Bool {
|
||||||
|
return FileManager.default.isDeletableFile(atPath: string)
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns true if the path represents an actual directory.
|
/// Returns true if the path represents an actual directory.
|
||||||
var isDirectory: Bool {
|
var isDirectory: Bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user