fortrangoingonforty/fortress / ae3b99b

Browse files

cleanup

Authored by espadonne
SHA
ae3b99b38a252cd35b36259a200f5a11c3b9b585
Parents
33e7109
Tree
23d3099

7 changed files

StatusFile+-
A LICENSE 21 0
M README.md 1 52
A USAGE.md 47 0
M app/main.f90 2 1
A aur-files.txt 48 0
A contrived/test_staged.txt 1 0
A scratch/scratchy/demo/scratch.txt 1 0
LICENSEadded
@@ -0,0 +1,21 @@
1
+MIT License
2
+
3
+Copyright (c) 2024 Matthew Wolffe and FORTRESS contributors
4
+
5
+Permission is hereby granted, free of charge, to any person obtaining a copy
6
+of this software and associated documentation files (the "Software"), to deal
7
+in the Software without restriction, including without limitation the rights
8
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+copies of the Software, and to permit persons to whom the Software is
10
+furnished to do so, subject to the following conditions:
11
+
12
+The above copyright notice and this permission notice shall be included in all
13
+copies or substantial portions of the Software.
14
+
15
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+SOFTWARE.
README.mdmodified
@@ -61,43 +61,6 @@ fortress # instead of 'fpm run'
61
 
61
 
62
 This allows you to navigate to directories and have your shell follow when you press 'c'.
62
 This allows you to navigate to directories and have your shell follow when you press 'c'.
63
 
63
 
64
-### Development
65
-
66
-```bash
67
-# Run tests
68
-fpm test
69
-
70
-# Build with debug flags
71
-fpm build --flag "-g -Wall -Wextra"
72
-```
73
-
74
-## Current Features
75
-
76
-- ✅ **Dual-pane display** inspired by Ranger/MC (parent dir 30% | current dir 70%)
77
-- ✅ **Real filesystem navigation** with directory reading
78
-- ✅ **Smart selection memory** - remembers position when navigating
79
-- ✅ **Visual hierarchy** - dimmed parent pane, active current pane
80
-- ✅ **Color-coded files**:
81
-  - Directories: Blue + bold
82
-  - Executable files: Green
83
-  - Dotfiles: Grey
84
-  - Regular files: White
85
-- ✅ **Smooth updates** - no flashing, selective redraws
86
-- ✅ **Arrow key navigation** for intuitive movement
87
-- ✅ **Full-width selection bar** - clean highlighting
88
-- ✅ **CD on exit** - press 'c' to navigate your shell to selected directory
89
-
90
-## Next Steps
91
-
92
-- [ ] File opening with $EDITOR (Enter on files)
93
-- [ ] FZF integration for fuzzy search (Ctrl-F)
94
-- [ ] File operations (copy, move, delete)
95
-- [ ] Configuration file support
96
-
97
-## Roadmap
98
-
99
-See [ROADMAP.md](ROADMAP.md) for detailed development plans.
100
-
101
 ## Controls
64
 ## Controls
102
 
65
 
103
 - `↑/↓`: Navigate up/down
66
 - `↑/↓`: Navigate up/down
@@ -106,20 +69,6 @@ See [ROADMAP.md](ROADMAP.md) for detailed development plans.
106
 - `c`: CD to selected directory and exit (requires shell integration)
69
 - `c`: CD to selected directory and exit (requires shell integration)
107
 - `q`: Quit
70
 - `q`: Quit
108
 
71
 
109
-## Architecture
110
-
111
-FORTRESS is built as a self-contained file explorer:
112
-
113
-- `app/main.f90`: Main application with integrated UI and file operations
114
-- `lib_modules/`: Modular components (available for future expansion)
115
-  - `filesystem/`: File operations and directory walking
116
-  - `terminal/`: Terminal I/O and screen management
117
-  - `ui/`: User interface components (panes, rendering)
118
-
119
-## Packaging
120
-
121
-For AUR maintainers, see [AUR_PACKAGING.md](AUR_PACKAGING.md) for complete packaging instructions.
122
-
123
 ## License
72
 ## License
124
 
73
 
125
-MIT
74
+MIT
USAGE.mdadded
@@ -0,0 +1,47 @@
1
+# Using FORTRESS with CD-on-Exit
2
+
3
+## Setup (One Time)
4
+
5
+Add this line to your `~/.bashrc` or `~/.zshrc`:
6
+
7
+```bash
8
+source ~/Documents/GithubOrgs/FortranGoingOnForty/fortress/fortress.sh
9
+```
10
+
11
+Then reload your shell:
12
+```bash
13
+source ~/.bashrc  # or source ~/.zshrc
14
+```
15
+
16
+## Usage
17
+
18
+Instead of running `fpm run`, use the `fortress` command:
19
+
20
+```bash
21
+fortress
22
+```
23
+
24
+This runs the fortress file explorer. When you're browsing:
25
+
26
+1. Use `↑↓` to navigate files/directories
27
+2. Use `→` to enter a directory
28
+3. Use `←` to go back
29
+4. **Press `c` on any directory to exit fortress and CD your shell to that directory**
30
+5. Press `q` to quit without changing directory
31
+
32
+## How It Works
33
+
34
+When you press `c`:
35
+1. FORTRESS writes the selected directory path to `~/.fortress_cd`
36
+2. FORTRESS exits
37
+3. The shell function reads `~/.fortress_cd` and runs `cd` to that directory
38
+4. The temp file is cleaned up
39
+
40
+This is the same pattern used by tools like `fzf`.
41
+
42
+## Important Notes
43
+
44
+- ❌ `fpm run` does NOT enable cd-on-exit (it runs directly)
45
+- ✅ `fortress` command DOES enable cd-on-exit (uses the shell function)
46
+- You must source `fortress.sh` in your shell config for this to work
47
+- This only works in interactive shells, not in scripts
app/main.f90modified
@@ -5,6 +5,7 @@ program fortress_clean
5
     ! Constants
5
     ! Constants
6
     integer, parameter :: MAX_PATH = 512
6
     integer, parameter :: MAX_PATH = 512
7
     integer, parameter :: MAX_FILES = 500
7
     integer, parameter :: MAX_FILES = 500
8
+    
8
     character(len=*), parameter :: ESC = char(27)
9
     character(len=*), parameter :: ESC = char(27)
9
     character(len=*), parameter :: CLEAR = ESC // "[2J" // ESC // "[H"
10
     character(len=*), parameter :: CLEAR = ESC // "[2J" // ESC // "[H"
10
     character(len=*), parameter :: BOLD = ESC // "[1m"
11
     character(len=*), parameter :: BOLD = ESC // "[1m"
@@ -355,4 +356,4 @@ contains
355
         end if
356
         end if
356
     end subroutine write_exit_dir
357
     end subroutine write_exit_dir
357
 
358
 
358
-end program fortress_clean
359
+end program fortress_clean
aur-files.txtadded
@@ -0,0 +1,48 @@
1
+# AUR Files Ready for Deployment
2
+
3
+## Files for AUR Repository
4
+
5
+You need to push these 3 files to your AUR repository:
6
+
7
+1. **PKGBUILD** - Build instructions
8
+2. **.SRCINFO** - Package metadata  
9
+3. **fortress.install** - Post-install script
10
+
11
+## Current Status
12
+
13
+✅ PKGBUILD - Ready
14
+✅ .SRCINFO - Generated (update sha256sum before pushing)
15
+✅ fortress.install - Ready
16
+
17
+## To Deploy to AUR
18
+
19
+```bash
20
+# On your AUR server:
21
+cd /path/to/aur/fortress
22
+
23
+# Copy these three files
24
+cp PKGBUILD .SRCINFO fortress.install .
25
+
26
+# Before first push, you MUST:
27
+# 1. Create GitHub release v0.1.0
28
+# 2. Update sha256sums in PKGBUILD
29
+# 3. Regenerate .SRCINFO: makepkg --printsrcinfo > .SRCINFO
30
+
31
+# Then commit
32
+git add PKGBUILD .SRCINFO fortress.install
33
+git commit -m "Initial import of fortress v0.1.0"
34
+git push
35
+```
36
+
37
+## Important Notes
38
+
39
+- **sha256sums = SKIP**: Change this to actual checksum before pushing
40
+- **.SRCINFO**: Must be regenerated with `makepkg --printsrcinfo` on Linux after any PKGBUILD changes
41
+- Both files are ready to copy to your AUR server now
42
+
43
+## Three Files You Need
44
+
45
+All located in project root:
46
+- PKGBUILD
47
+- .SRCINFO
48
+- fortress.install
contrived/test_staged.txtadded
@@ -0,0 +1,1 @@
1
+blah
scratch/scratchy/demo/scratch.txtadded
@@ -0,0 +1,1 @@
1
+scratch