Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

505 B
Raw Blame
import Darwin

enum InstallationPublish {
  enum Decision {
    case adoptedExisting
    /// Exclusive rename of a complete temporary file onto the marker path.
    case createExclusive
    case unavailable
  }

  static func decide(errno code: Int32) -> Decision {
    if code == EEXIST { return .adoptedExisting }
    if code == EACCES || code == EPERM || code == EXDEV || code == ENOSYS
      || code == ENOTSUP || code == EOPNOTSUPP {
      return .createExclusive
    }
    return .unavailable
  }
}