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
4 changes: 2 additions & 2 deletions Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.1.14</string>
<string>0.1.15</string>
<key>CFBundleVersion</key>
<string>14</string>
<string>15</string>
<key>LSMinimumSystemVersion</key>
<string>14.0</string>
<key>LSUIElement</key>
Expand Down
2 changes: 1 addition & 1 deletion Sources/CodexToolbar/App/CodexToolbarApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ enum AppVersion {
return version
}

return "0.1.14"
return "0.1.15"
}()

private static func developmentVersionFromSourceInfoPlist() -> String? {
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexToolbar/Networking/CodexAppServerClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ actor CodexAppServerClient: CodexRateLimitClient {

nonisolated static func codexPathCandidates(environmentPath: String, homeDirectory: String) -> [String] {
let preferredAppCandidates = [
"/Applications/ChatGPT.app/Contents/Resources/codex",
URL(fileURLWithPath: homeDirectory).appendingPathComponent("Applications/ChatGPT.app/Contents/Resources/codex").path,
"/Applications/Codex.app/Contents/Resources/codex",
URL(fileURLWithPath: homeDirectory).appendingPathComponent("Applications/Codex.app/Contents/Resources/codex").path
]
Expand Down
4 changes: 3 additions & 1 deletion Sources/CodexToolbar/Support/CodexDesktopAppController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ struct CodexDesktopAppLocator {

static func appBundleCandidates(homeDirectory: String) -> [String] {
let candidates = [
"/Applications/ChatGPT.app",
URL(fileURLWithPath: homeDirectory).appendingPathComponent("Applications/ChatGPT.app").path,
"/Applications/Codex.app",
URL(fileURLWithPath: homeDirectory).appendingPathComponent("Applications/Codex.app").path
]
Expand Down Expand Up @@ -55,7 +57,7 @@ enum CodexDesktopAppError: LocalizedError, Equatable {
var errorDescription: String? {
switch self {
case .notFound:
return "Codex.app was not found."
return "Codex desktop app was not found."
}
}
}
Expand Down
10 changes: 7 additions & 3 deletions Tests/CodexToolbarTests/CodexAppServerClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ final class CodexAppServerClientTests: XCTestCase {
)

XCTAssertEqual(
candidates.prefix(4),
candidates.prefix(6),
[
"/Applications/ChatGPT.app/Contents/Resources/codex",
"/Users/example/Applications/ChatGPT.app/Contents/Resources/codex",
"/Applications/Codex.app/Contents/Resources/codex",
"/Users/example/Applications/Codex.app/Contents/Resources/codex",
"/usr/bin/codex",
"/bin/codex"
]
)
XCTAssertTrue(candidates.contains("/Applications/ChatGPT.app/Contents/Resources/codex"))
XCTAssertTrue(candidates.contains("/Users/example/Applications/ChatGPT.app/Contents/Resources/codex"))
XCTAssertTrue(candidates.contains("/Applications/Codex.app/Contents/Resources/codex"))
XCTAssertTrue(candidates.contains("/Users/example/Applications/Codex.app/Contents/Resources/codex"))
XCTAssertTrue(candidates.contains("/Users/example/.local/bin/codex"))
Expand All @@ -30,11 +34,11 @@ final class CodexAppServerClientTests: XCTestCase {

func testCodexPathCandidatesDeduplicateEntries() {
let candidates = CodexAppServerClient.codexPathCandidates(
environmentPath: "/Applications/Codex.app/Contents/Resources:/opt/homebrew/bin:/Applications/Codex.app/Contents/Resources",
environmentPath: "/Applications/ChatGPT.app/Contents/Resources:/opt/homebrew/bin:/Applications/ChatGPT.app/Contents/Resources",
homeDirectory: "/Users/example"
)

XCTAssertEqual(candidates.filter { $0 == "/Applications/Codex.app/Contents/Resources/codex" }.count, 1)
XCTAssertEqual(candidates.filter { $0 == "/Applications/ChatGPT.app/Contents/Resources/codex" }.count, 1)
}

func testParseLoginStatusTreatsExitZeroAsLoggedIn() {
Expand Down
2 changes: 2 additions & 0 deletions Tests/CodexToolbarTests/CodexDesktopAppControllerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ final class CodexDesktopAppControllerTests: XCTestCase {
let candidates = CodexDesktopAppLocator.appBundleCandidates(homeDirectory: "/Users/example")

XCTAssertEqual(candidates, [
"/Applications/ChatGPT.app",
"/Users/example/Applications/ChatGPT.app",
"/Applications/Codex.app",
"/Users/example/Applications/Codex.app"
])
Expand Down