Skip to content

Commit b4b8c66

Browse files
Merge pull request #5 from LucaTools/rename-active-to-tools
Rename .luca/active to .luca/tools
2 parents 6f82069 + 7bd5066 commit b4b8c66

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ flowchart TB
4444
4545
U2 --> SH
4646
SH --> PATH
47-
PATH -->|adds/removes| .luca/active
47+
PATH -->|adds/removes| .luca/tools
4848
4949
U3 --> PC
5050
PC -->|may call| IS
@@ -141,22 +141,22 @@ flowchart TD
141141
subgraph EveryPrompt["⚡ Before Every Prompt"]
142142
Prompt[User presses Enter<br/>or changes directory] --> UpdatePath[update_path runs]
143143
144-
UpdatePath --> CheckLucaDir{".luca/active"<br/>exists in pwd?}
144+
UpdatePath --> CheckLucaDir{".luca/tools"<br/>exists in pwd?}
145145
146146
CheckLucaDir -->|Yes| CheckInPath{Already in PATH?}
147147
CheckLucaDir -->|No| CleanupPath
148148
149149
CheckInPath -->|Yes| Done1[Do nothing<br/>idempotent]
150-
CheckInPath -->|No| AddToPath["Add .luca/active<br/>to front of PATH"]
150+
CheckInPath -->|No| AddToPath["Add .luca/tools<br/>to front of PATH"]
151151
152152
AddToPath --> Done2[PATH updated ✅]
153153
154-
CleanupPath{Any .luca/active<br/>entries in PATH?}
154+
CleanupPath{Any .luca/tools<br/>entries in PATH?}
155155
CleanupPath -->|No| Done3[Nothing to clean]
156156
CleanupPath -->|Yes| FilterPath
157157
158158
FilterPath[For each PATH entry...]
159-
FilterPath --> IsLucaEntry{Is .luca/active<br/>entry?}
159+
FilterPath --> IsLucaEntry{Is .luca/tools<br/>entry?}
160160
161161
IsLucaEntry -->|No| Keep[Keep in PATH]
162162
IsLucaEntry -->|Yes| CheckSubdir{Current dir is<br/>project or subdir?}
@@ -323,7 +323,7 @@ sequenceDiagram
323323
U->>T: Open new terminal
324324
T->>SH: Source shell_hook.sh
325325
SH->>SH: Register precmd hook
326-
SH->>T: Check pwd for .luca/active
326+
SH->>T: Check pwd for .luca/tools
327327
328328
Note over U,L: Daily Usage - Switching Branches
329329
U->>G: git checkout feature-branch
@@ -337,13 +337,13 @@ sequenceDiagram
337337
Note over U,L: Daily Usage - Navigating Directories
338338
U->>T: cd ~/project
339339
T->>SH: precmd triggers update_path
340-
SH->>SH: Add .luca/active to PATH
340+
SH->>SH: Add .luca/tools to PATH
341341
U->>T: which <tool>
342-
T-->>U: ~/project/.luca/active/<tool>
342+
T-->>U: ~/project/.luca/tools/<tool>
343343
344344
U->>T: cd ~
345345
T->>SH: precmd triggers update_path
346-
SH->>SH: Remove .luca/active from PATH
346+
SH->>SH: Remove .luca/tools from PATH
347347
```
348348

349349
---

shell_hook.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ TOOL_FOLDER=".luca"
3535
# When navigating to subdirectories of a project, it keeps the project's tool path in PATH.
3636
update_path() {
3737
# Look for the active tools directory in the current location
38-
local tool_bin_dir="$(pwd)/$TOOL_FOLDER/active"
38+
local tool_bin_dir="$(pwd)/$TOOL_FOLDER/tools"
3939
local current_pwd="$(pwd)"
4040

4141
# Only proceed if the tool directory exists in the current directory
@@ -54,9 +54,9 @@ update_path() {
5454
;;
5555
esac
5656
else
57-
# Current directory doesn't have .luca/active
58-
# Check if there are any .luca/active entries in PATH that should be cleaned up
59-
if [[ ":$PATH:" == *"/$TOOL_FOLDER/active:"* ]]; then
57+
# Current directory doesn't have .luca/tools
58+
# Check if there are any .luca/tools entries in PATH that should be cleaned up
59+
if [[ ":$PATH:" == *"/$TOOL_FOLDER/tools:"* ]]; then
6060
local p
6161
local new_path=""
6262
local current_path="$PATH"
@@ -70,10 +70,10 @@ update_path() {
7070
current_path="${current_path#*:}"
7171
fi
7272

73-
if [[ "$p" == *"/$TOOL_FOLDER/active" ]]; then
73+
if [[ "$p" == *"/$TOOL_FOLDER/tools" ]]; then
7474
# This is a tool directory entry - check if we should keep it
75-
# Get the project root (parent of .luca/active)
76-
local project_root="${p%/$TOOL_FOLDER/active}"
75+
# Get the project root (parent of .luca/tools)
76+
local project_root="${p%/$TOOL_FOLDER/tools}"
7777
# Keep this entry if current directory is the project root or a subdirectory of it
7878
if [[ "$current_pwd" == "$project_root" || "$current_pwd" == "$project_root/"* ]]; then
7979
new_path="${new_path:+$new_path:}$p"

0 commit comments

Comments
 (0)