PathKit icon indicating copy to clipboard operation
PathKit copied to clipboard

It has problem when used in App(not SPM or Terminal)

Open yunluoxin opened this issue 2 years ago • 0 comments

macOS Version: 12.5.1

Xcode: 14.0

Example (execute in macOS App):

        let p = Path("/Users/your-name/Desktops")
        let p2 = Path("~/Desktops")
        print(p ~= p2) // false

Reason:

  • When in macOS App, Apple use symbol link in sandbox to show Desktops / Documents / Downloads. When I print p2, I found it was /Users/your-name/xxx/your-App/Data/Desktops which is symbol link to real Desktops. And the ~= result is false.
  • When is Swift Package CLI, the result is true.

yunluoxin avatar Nov 24 '22 03:11 yunluoxin