Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Settings > Editor grouped into Display, Gutter and Editing.
- Editor Font and Data Grid Font moved to Settings > Editor and Settings > Data, and kept per Mac.
- Editor font size range of 10 to 24 points everywhere, including zoom.
- tablepro command ships inside the app. Settings > General shows the Terminal line that links it; no administrator prompt.
- MCP server runs only while Enable MCP Server is on in Settings > MCP. Clients and pairing no longer start it while it is off.
- Edit > Data shown only in data file windows.
- Delta updates from the last five releases, about 6 MB instead of the full 34 MB download.
Expand Down
2 changes: 2 additions & 0 deletions TablePro/CLI/tablepro
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec open -b com.TablePro "$@"
57 changes: 57 additions & 0 deletions TablePro/Core/Services/Infrastructure/CommandLineShim.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//
// CommandLineShim.swift
// TablePro
//

import Foundation

internal enum CommandLineShimStatus: Equatable, Sendable {
case linked
case notLinked
case otherFile
}

/// The `tablepro` shim ships in the bundle and the person links it onto their PATH with a command
/// they run themselves, so the app never writes outside its own container or asks for admin rights.
internal struct CommandLineShim: Sendable {
internal static let linkPath = "/usr/local/bin/tablepro"

internal let shimPath: String
internal let linkPath: String

internal init(bundle: Bundle = .main, linkPath: String = CommandLineShim.linkPath) {
let sharedSupport = bundle.sharedSupportURL ?? bundle.bundleURL.appendingPathComponent("Contents/SharedSupport")
self.init(shimPath: sharedSupport.appendingPathComponent("bin/tablepro").path, linkPath: linkPath)
}

internal init(shimPath: String, linkPath: String) {
self.shimPath = shimPath
self.linkPath = linkPath
}

internal func status(fileManager: FileManager = .default) -> CommandLineShimStatus {
if let destination = try? fileManager.destinationOfSymbolicLink(atPath: linkPath) {
let resolved = URL(fileURLWithPath: destination, relativeTo: URL(fileURLWithPath: linkPath))
return resolved.standardizedFileURL.path == URL(fileURLWithPath: shimPath).standardizedFileURL.path
? .linked
: .otherFile
}
return fileManager.fileExists(atPath: linkPath) ? .otherFile : .notLinked
}

/// `rm -f` first: `ln -sf` onto a link to a directory writes inside that directory, and `rm`
/// refuses a real directory, so the line stops instead of touching one.
internal var linkCommand: String {
let directory = (linkPath as NSString).deletingLastPathComponent
let link = Self.quote(linkPath)
return "sudo mkdir -p \(Self.quote(directory)) && sudo rm -f \(link) && sudo ln -s \(Self.quote(shimPath)) \(link)"
}

internal var unlinkCommand: String {
"sudo rm \(Self.quote(linkPath))"
}

internal static func quote(_ value: String) -> String {
"'" + value.replacingOccurrences(of: "'", with: "'\\''") + "'"
}
}
164 changes: 0 additions & 164 deletions TablePro/Core/Services/Infrastructure/CommandLineToolInstaller.swift

This file was deleted.

70 changes: 0 additions & 70 deletions TablePro/Core/Services/Infrastructure/PrivilegedShell.swift

This file was deleted.

Loading
Loading