Skip to content

Commit 35c8cd6

Browse files
Add installer script, change repository feature, and update docs
- Add scripts/install.sh for one-command installation - Add 'Change Repository' button in sidebar and toolbar - Add 'Close Repository' menu item (Cmd+Shift+W) - Update README with installation options
1 parent 7a031c3 commit 35c8cd6

File tree

4 files changed

+128
-5
lines changed

4 files changed

+128
-5
lines changed

GitFlow/App/GitFlowApp.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ struct GitFlowApp: App {
1919
}
2020
.keyboardShortcut("o", modifiers: .command)
2121

22+
Button("Close Repository") {
23+
appState.closeRepository()
24+
}
25+
.keyboardShortcut("w", modifiers: [.command, .shift])
26+
.disabled(appState.currentRepository == nil)
27+
2228
Divider()
2329

2430
Menu("Recent Repositories") {

GitFlow/Views/Main/MainWindow.swift

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ struct WelcomeView: View {
141141

142142
/// Main repository view with navigation and content.
143143
struct RepositoryView: View {
144+
@EnvironmentObject private var appState: AppState
144145
@ObservedObject var viewModel: RepositoryViewModel
145146

146147
@State private var selectedSection: SidebarSection = .changes
@@ -152,6 +153,23 @@ struct RepositoryView: View {
152153
viewModel: viewModel
153154
)
154155
.frame(minWidth: 200)
156+
.safeAreaInset(edge: .bottom) {
157+
Button(action: {
158+
appState.closeRepository()
159+
}) {
160+
HStack(spacing: DSSpacing.iconTextSpacing) {
161+
Image(systemName: "chevron.left")
162+
Text("Change Repository")
163+
}
164+
.font(DSTypography.secondaryContent())
165+
.foregroundStyle(.secondary)
166+
.frame(maxWidth: .infinity, alignment: .leading)
167+
.padding(.horizontal, DSSpacing.md)
168+
.padding(.vertical, DSSpacing.sm)
169+
}
170+
.buttonStyle(.plain)
171+
.background(Color(NSColor.separatorColor).opacity(0.1))
172+
}
155173
} detail: {
156174
ContentArea(
157175
selectedSection: selectedSection,
@@ -160,6 +178,15 @@ struct RepositoryView: View {
160178
}
161179
.navigationTitle(viewModel.repository.name)
162180
.toolbar {
181+
ToolbarItemGroup(placement: .navigation) {
182+
Button(action: {
183+
appState.closeRepository()
184+
}) {
185+
Image(systemName: "folder.badge.gearshape")
186+
}
187+
.help("Change Repository")
188+
}
189+
163190
ToolbarItemGroup(placement: .primaryAction) {
164191
if let branch = viewModel.currentBranch {
165192
HStack(spacing: 4) {

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,31 @@ A free, professional-grade Git GUI for macOS with best-in-class diff visualizati
88

99
## Install
1010

11-
### Homebrew (Recommended)
11+
### Quick Install (Recommended)
12+
13+
Run this command in Terminal:
14+
15+
```bash
16+
curl -fsSL https://raw.githubusercontent.com/Nicolas-Arsenault/GitFlow/main/scripts/install.sh | bash
17+
```
18+
19+
This downloads, installs, and configures GitFlow automatically.
20+
21+
### Homebrew
1222

1323
```bash
1424
brew tap nicolas-arsenault/tap
1525
brew install --cask gitflow-gui
1626
```
1727

18-
### Direct Download
19-
20-
Download the latest DMG from [Releases](https://github.com/Nicolas-Arsenault/GitFlow/releases).
28+
### Manual Download
2129

22-
> **Note:** On first launch, right-click the app and select "Open" (or run `xattr -cr /Applications/GitFlow.app` in Terminal) since the app isn't notarized yet.
30+
1. Download the latest DMG from [Releases](https://github.com/Nicolas-Arsenault/GitFlow/releases)
31+
2. Open the DMG and drag GitFlow to Applications
32+
3. Run this command to avoid security warnings:
33+
```bash
34+
xattr -cr /Applications/GitFlow.app
35+
```
2336

2437
## Features
2538

scripts/install.sh

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#!/bin/bash
2+
#
3+
# GitFlow Installer Script
4+
# Downloads and installs GitFlow, removing macOS quarantine to avoid security warnings.
5+
#
6+
7+
set -e
8+
9+
APP_NAME="GitFlow"
10+
VERSION="1.0.3"
11+
DMG_URL="https://github.com/Nicolas-Arsenault/GitFlow/releases/download/v${VERSION}/GitFlow-${VERSION}.dmg"
12+
DMG_FILE="/tmp/GitFlow-${VERSION}.dmg"
13+
MOUNT_POINT="/Volumes/GitFlow"
14+
INSTALL_PATH="/Applications"
15+
16+
echo "╔════════════════════════════════════════╗"
17+
echo "║ GitFlow Installer v${VERSION}"
18+
echo "╚════════════════════════════════════════╝"
19+
echo ""
20+
21+
# Check if running on macOS
22+
if [[ "$(uname)" != "Darwin" ]]; then
23+
echo "Error: This installer is for macOS only."
24+
exit 1
25+
fi
26+
27+
# Check macOS version (requires 13+)
28+
macos_version=$(sw_vers -productVersion | cut -d. -f1)
29+
if [[ "$macos_version" -lt 13 ]]; then
30+
echo "Error: GitFlow requires macOS 13 (Ventura) or later."
31+
echo "Your version: $(sw_vers -productVersion)"
32+
exit 1
33+
fi
34+
35+
# Download DMG
36+
echo "→ Downloading GitFlow v${VERSION}..."
37+
curl -L -o "$DMG_FILE" "$DMG_URL" --progress-bar
38+
39+
# Unmount if already mounted
40+
if [[ -d "$MOUNT_POINT" ]]; then
41+
echo "→ Unmounting existing volume..."
42+
hdiutil detach "$MOUNT_POINT" -quiet 2>/dev/null || true
43+
fi
44+
45+
# Mount DMG
46+
echo "→ Mounting disk image..."
47+
hdiutil attach "$DMG_FILE" -quiet
48+
49+
# Remove old installation if exists
50+
if [[ -d "${INSTALL_PATH}/${APP_NAME}.app" ]]; then
51+
echo "→ Removing previous installation..."
52+
rm -rf "${INSTALL_PATH}/${APP_NAME}.app"
53+
fi
54+
55+
# Copy app to Applications
56+
echo "→ Installing to /Applications..."
57+
cp -R "${MOUNT_POINT}/${APP_NAME}.app" "$INSTALL_PATH/"
58+
59+
# Remove quarantine attribute (avoids Apple security warning)
60+
echo "→ Configuring security settings..."
61+
xattr -cr "${INSTALL_PATH}/${APP_NAME}.app"
62+
63+
# Unmount DMG
64+
echo "→ Cleaning up..."
65+
hdiutil detach "$MOUNT_POINT" -quiet
66+
rm -f "$DMG_FILE"
67+
68+
echo ""
69+
echo "✓ GitFlow has been installed successfully!"
70+
echo ""
71+
echo "You can now open GitFlow from:"
72+
echo " • Applications folder"
73+
echo " • Spotlight (Cmd+Space, type 'GitFlow')"
74+
echo ""
75+
echo "To open now, run:"
76+
echo " open -a GitFlow"
77+
echo ""

0 commit comments

Comments
 (0)