Skip to content

Commit 443ea8e

Browse files
committed
first commit
0 parents  commit 443ea8e

File tree

8 files changed

+65
-0
lines changed

8 files changed

+65
-0
lines changed

.github/workflows/lint.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: lint
2+
on: [push]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- name: ShellCheck
9+
uses: ludeeus/action-shellcheck@v2
10+
- name: Bats
11+
uses: mig4/setup-bats@v1
12+
- run: bats test

CHANGELOG.md

Whitespace-only changes.

LICENSE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Nicholas Pijpers
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Whitespace-only changes.

_proj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#compdef proj
2+
3+
_arguments \
4+
'1:project name:_files -W "$DEV_ROOT" -/"*"' && return 0

bin/proj-cd

Whitespace-only changes.

proj.plugin.zsh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env zsh
2+
# proj-jumper — jump to a project inside $DEV_ROOT
3+
4+
# --- configuration ----------------------------------------------------------
5+
: ${DEV_ROOT:=${PROJ_DEV_ROOT:-"/Volumes/dog_house/development/projects"}}
6+
7+
# allow users to export PROJ_DEV_ROOT or DEV_ROOT to override
8+
export DEV_ROOT
9+
10+
# --- function ---------------------------------------------------------------
11+
proj () {
12+
# 1. verify disk
13+
[[ -d $DEV_ROOT ]] || { print -u2 "⚠️ $DEV_ROOT not found"; return 1 }
14+
15+
# 2. arg-aware behaviour
16+
if [[ -z $1 ]]; then
17+
# no arg → interactive picker if fzf present, else list
18+
if command -v fzf >/dev/null; then
19+
local sel
20+
sel=$(command ls -1 "$DEV_ROOT" | fzf --prompt='project> ')
21+
[[ -n $sel ]] && cd "$DEV_ROOT/$sel"
22+
else
23+
print "Projects:"; command ls "$DEV_ROOT"
24+
fi
25+
else
26+
# arg → direct cd with safety
27+
local target="$DEV_ROOT/$1"
28+
[[ -d $target ]] && cd "$target" || {
29+
print -u2 "No such project: $1"; return 1
30+
}
31+
fi
32+
}
33+
34+
# --- completion hook --------------------------------------------------------
35+
# Late-bound because the volume could mount after shell start
36+
_proj_complete () {
37+
[[ -d $DEV_ROOT ]] || return
38+
compadd -- $(command ls -1 "$DEV_ROOT")
39+
}
40+
compdef _proj_complete proj

test/proj_spec.bats

Whitespace-only changes.

0 commit comments

Comments
 (0)