Fixes
This commit is contained in:
+13
-4
@@ -1,6 +1,19 @@
|
|||||||
project_root := justfile_directory()
|
project_root := justfile_directory()
|
||||||
bin_script_dir := project_root + "/Scripts/bin"
|
bin_script_dir := project_root + "/Scripts/bin"
|
||||||
|
|
||||||
|
# List the repo-managed binary names, or available releases for one tool.
|
||||||
|
[default]
|
||||||
|
list tool='':
|
||||||
|
if [ -n '{{tool}}' ]; then \
|
||||||
|
bash '{{bin_script_dir}}/update.sh' --list '{{tool}}'; \
|
||||||
|
else \
|
||||||
|
jq -r 'keys[]' '{{project_root}}/Bins/versions.json'; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# List available releases for a supported binary.
|
||||||
|
releases tool:
|
||||||
|
bash '{{bin_script_dir}}/update.sh' --list '{{tool}}'
|
||||||
|
|
||||||
# Install all pinned repo-managed binaries into ~/.local/bin.
|
# Install all pinned repo-managed binaries into ~/.local/bin.
|
||||||
install-all:
|
install-all:
|
||||||
bash '{{bin_script_dir}}/install.sh' --all
|
bash '{{bin_script_dir}}/install.sh' --all
|
||||||
@@ -13,10 +26,6 @@ install tool:
|
|||||||
update tool version='':
|
update tool version='':
|
||||||
bash '{{bin_script_dir}}/update.sh' '{{tool}}' '{{version}}'
|
bash '{{bin_script_dir}}/update.sh' '{{tool}}' '{{version}}'
|
||||||
|
|
||||||
# List available releases for a supported binary.
|
|
||||||
list tool:
|
|
||||||
bash '{{bin_script_dir}}/update.sh' --list '{{tool}}'
|
|
||||||
|
|
||||||
# Print the currently pinned versions.
|
# Print the currently pinned versions.
|
||||||
show:
|
show:
|
||||||
cat '{{project_root}}/Bins/versions.json'
|
cat '{{project_root}}/Bins/versions.json'
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
project_root := justfile_directory()
|
||||||
|
scripts_dir := project_root + "/Scripts"
|
||||||
|
|
||||||
|
# Print the active global Git configuration.
|
||||||
|
[default]
|
||||||
|
show:
|
||||||
|
bash '{{scripts_dir}}/git.sh' show
|
||||||
|
|
||||||
|
# Set the global Git editor. Defaults to VS Code; pass `nvim` for Neovim.
|
||||||
|
editor value='code':
|
||||||
|
bash '{{scripts_dir}}/git.sh' editor '{{value}}'
|
||||||
@@ -1,20 +1,29 @@
|
|||||||
project_root := justfile_directory()
|
project_root := justfile_directory()
|
||||||
scripts_dir := project_root + "/Scripts"
|
scripts_dir := project_root + "/Scripts"
|
||||||
|
|
||||||
|
# Install every language toolchain in full-setup order.
|
||||||
|
all: node go rust python r cpp
|
||||||
|
|
||||||
|
# Install Node.js, pnpm, Yarn, and Bun tooling.
|
||||||
node:
|
node:
|
||||||
bash '{{scripts_dir}}/node.sh'
|
bash '{{scripts_dir}}/node.sh'
|
||||||
|
|
||||||
|
# Install Go and GVM tooling.
|
||||||
go:
|
go:
|
||||||
bash '{{scripts_dir}}/go.sh'
|
bash '{{scripts_dir}}/go.sh'
|
||||||
|
|
||||||
|
# Install the Rust toolchain.
|
||||||
rust:
|
rust:
|
||||||
bash '{{scripts_dir}}/rust.sh'
|
bash '{{scripts_dir}}/rust.sh'
|
||||||
|
|
||||||
|
# Install Python, pyenv, and Miniforge tooling.
|
||||||
python:
|
python:
|
||||||
bash '{{scripts_dir}}/python.sh'
|
bash '{{scripts_dir}}/python.sh'
|
||||||
|
|
||||||
|
# Install R tooling.
|
||||||
r:
|
r:
|
||||||
bash '{{scripts_dir}}/r.sh'
|
bash '{{scripts_dir}}/r.sh'
|
||||||
|
|
||||||
|
# Install the C and C++ toolchain.
|
||||||
cpp:
|
cpp:
|
||||||
bash '{{scripts_dir}}/cpp.sh'
|
bash '{{scripts_dir}}/cpp.sh'
|
||||||
|
|||||||
@@ -2,9 +2,14 @@ project_root := justfile_directory()
|
|||||||
scripts_dir := project_root + "/Scripts"
|
scripts_dir := project_root + "/Scripts"
|
||||||
|
|
||||||
# Run the full setup flow.
|
# Run the full setup flow.
|
||||||
|
[default]
|
||||||
all:
|
all:
|
||||||
bash '{{scripts_dir}}/setup.sh'
|
bash '{{scripts_dir}}/setup.sh'
|
||||||
|
|
||||||
|
# Run the lightweight bootstrap flow: base packages and shell-file stow.
|
||||||
|
bootstrap:
|
||||||
|
bash '{{scripts_dir}}/setup.sh' --bootstrap-only
|
||||||
|
|
||||||
# Install the base system layer only.
|
# Install the base system layer only.
|
||||||
base:
|
base:
|
||||||
bash '{{scripts_dir}}/base.sh'
|
bash '{{scripts_dir}}/base.sh'
|
||||||
|
|||||||
@@ -1,59 +1,10 @@
|
|||||||
set shell := ["bash", "-cu"]
|
set shell := ["bash", "-cu"]
|
||||||
|
|
||||||
project_root := justfile_directory()
|
mod bin "Commands/Bin"
|
||||||
scripts_dir := project_root + "/Scripts"
|
mod git "Commands/Git"
|
||||||
bin_script_dir := scripts_dir + "/bin"
|
mod lang "Commands/Lang"
|
||||||
|
mod setup "Commands/Setup"
|
||||||
|
|
||||||
|
[default]
|
||||||
help:
|
help:
|
||||||
@printf '%s\n' \
|
just --list --list-submodules
|
||||||
'Dot-Zsh commands:' \
|
|
||||||
'' \
|
|
||||||
' just setup all # full setup flow' \
|
|
||||||
' just setup base # base layer only' \
|
|
||||||
' just setup stow # stow Zsh files into $HOME' \
|
|
||||||
' just setup clean # remove stowed Zsh files from $HOME' \
|
|
||||||
' just setup update # git pull + full setup' \
|
|
||||||
'' \
|
|
||||||
' just lang node # install Node tooling' \
|
|
||||||
' just lang go # install Go tooling' \
|
|
||||||
' just lang rust # install Rust tooling' \
|
|
||||||
' just lang python # install Python tooling' \
|
|
||||||
' just lang r # install R tooling' \
|
|
||||||
' just lang cpp # install C/C++ tooling' \
|
|
||||||
'' \
|
|
||||||
' just bin install-all # install all pinned binaries' \
|
|
||||||
' just bin install nvim # install one pinned binary' \
|
|
||||||
' just bin update nvim # update pinned version for a binary' \
|
|
||||||
' just bin list nvim # list available releases' \
|
|
||||||
' just bin show # print current pinned versions'
|
|
||||||
|
|
||||||
setup action='all':
|
|
||||||
case '{{action}}' in \
|
|
||||||
all) bash '{{scripts_dir}}/setup.sh' ;; \
|
|
||||||
base) bash '{{scripts_dir}}/base.sh' ;; \
|
|
||||||
stow) bash '{{scripts_dir}}/setup.sh' --stow-only ;; \
|
|
||||||
clean) stow --dir='{{project_root}}' -D Zsh --target="$HOME" ;; \
|
|
||||||
update) git -C '{{project_root}}' pull origin main && just --justfile '{{project_root}}/Justfile' setup all ;; \
|
|
||||||
*) printf 'Unknown setup action: %s\n' '{{action}}' >&2; exit 1 ;; \
|
|
||||||
esac
|
|
||||||
|
|
||||||
lang tool:
|
|
||||||
case '{{tool}}' in \
|
|
||||||
node) bash '{{scripts_dir}}/node.sh' ;; \
|
|
||||||
go) bash '{{scripts_dir}}/go.sh' ;; \
|
|
||||||
rust) bash '{{scripts_dir}}/rust.sh' ;; \
|
|
||||||
python) bash '{{scripts_dir}}/python.sh' ;; \
|
|
||||||
r) bash '{{scripts_dir}}/r.sh' ;; \
|
|
||||||
cpp) bash '{{scripts_dir}}/cpp.sh' ;; \
|
|
||||||
*) printf 'Unknown language target: %s\n' '{{tool}}' >&2; exit 1 ;; \
|
|
||||||
esac
|
|
||||||
|
|
||||||
bin action='show' tool='' version='':
|
|
||||||
case '{{action}}' in \
|
|
||||||
install-all) bash '{{bin_script_dir}}/install.sh' --all ;; \
|
|
||||||
install) [ -n '{{tool}}' ] || { printf 'bin install requires a tool name\n' >&2; exit 1; }; bash '{{bin_script_dir}}/install.sh' '{{tool}}' ;; \
|
|
||||||
update) [ -n '{{tool}}' ] || { printf 'bin update requires a tool name\n' >&2; exit 1; }; bash '{{bin_script_dir}}/update.sh' '{{tool}}' '{{version}}' ;; \
|
|
||||||
list) [ -n '{{tool}}' ] || { printf 'bin list requires a tool name\n' >&2; exit 1; }; bash '{{bin_script_dir}}/update.sh' --list '{{tool}}' ;; \
|
|
||||||
show) cat '{{project_root}}/Bins/versions.json' ;; \
|
|
||||||
*) printf 'Unknown bin action: %s\n' '{{action}}' >&2; exit 1 ;; \
|
|
||||||
esac
|
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ Modular `just` commands.
|
|||||||
- `Commands/Setup/mod.just`
|
- `Commands/Setup/mod.just`
|
||||||
- `Commands/Lang/mod.just`
|
- `Commands/Lang/mod.just`
|
||||||
- `Commands/Bin/mod.just`
|
- `Commands/Bin/mod.just`
|
||||||
|
- `Commands/Git/mod.just`
|
||||||
|
|
||||||
#### `Bins/`
|
#### `Bins/`
|
||||||
|
|
||||||
@@ -104,10 +105,15 @@ This runs the full flow in `Scripts/setup.sh`:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
just setup base
|
just setup base
|
||||||
|
just setup bootstrap
|
||||||
just setup stow
|
just setup stow
|
||||||
just setup clean
|
just setup clean
|
||||||
just setup update
|
just setup update
|
||||||
|
|
||||||
|
just git show
|
||||||
|
just git editor
|
||||||
|
just git editor nvim
|
||||||
|
|
||||||
just lang node
|
just lang node
|
||||||
just lang go
|
just lang go
|
||||||
just lang rust
|
just lang rust
|
||||||
@@ -116,14 +122,21 @@ just lang r
|
|||||||
just lang cpp
|
just lang cpp
|
||||||
|
|
||||||
just bin show
|
just bin show
|
||||||
|
just bin list
|
||||||
just bin install-all
|
just bin install-all
|
||||||
just bin install nvim
|
just bin install nvim
|
||||||
just bin list nvim
|
just bin releases nvim
|
||||||
|
just bin list nvim # backwards-compatible shorthand for releases
|
||||||
just bin update nvim
|
just bin update nvim
|
||||||
|
|
||||||
|
just lang all
|
||||||
```
|
```
|
||||||
|
|
||||||
If `fzf` is available, `just bin update <tool>` can use interactive selection.
|
If `fzf` is available, `just bin update <tool>` can use interactive selection.
|
||||||
|
|
||||||
|
`just setup all` and `just setup base` now set the default global Git editor to VS Code (`code --wait`).
|
||||||
|
If you want to switch to Neovim later, run `just git editor nvim`.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Secrets model
|
## Secrets model
|
||||||
|
|||||||
@@ -402,6 +402,8 @@ else
|
|||||||
ensure_git_credential_helper 'cache --timeout=43200'
|
ensure_git_credential_helper 'cache --timeout=43200'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
git config --global core.editor "code --wait"
|
||||||
|
|
||||||
# 6. Cleanup & Secrets
|
# 6. Cleanup & Secrets
|
||||||
rm -f "$HOME/.zshrc" "$HOME/.zsh_aliases"
|
rm -f "$HOME/.zshrc" "$HOME/.zsh_aliases"
|
||||||
mkdir -p "$REPO_ROOT/Zsh"
|
mkdir -p "$REPO_ROOT/Zsh"
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
cat <<'EOF'
|
||||||
|
Usage:
|
||||||
|
git.sh show
|
||||||
|
git.sh editor [code|nvim]
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
set_editor() {
|
||||||
|
local editor_name="${1:-code}"
|
||||||
|
|
||||||
|
case "$editor_name" in
|
||||||
|
code)
|
||||||
|
git config --global core.editor "code --wait"
|
||||||
|
printf 'Set git core.editor to: %s\n' 'code --wait'
|
||||||
|
;;
|
||||||
|
nvim)
|
||||||
|
git config --global core.editor "nvim"
|
||||||
|
printf 'Set git core.editor to: %s\n' 'nvim'
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
printf 'Unknown editor: %s\n' "$editor_name" >&2
|
||||||
|
usage >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
show_config() {
|
||||||
|
local name email editor
|
||||||
|
local helpers=()
|
||||||
|
local helper
|
||||||
|
|
||||||
|
name="$(git config --global --get user.name || true)"
|
||||||
|
email="$(git config --global --get user.email || true)"
|
||||||
|
editor="$(git config --global --get core.editor || true)"
|
||||||
|
|
||||||
|
while IFS= read -r helper; do
|
||||||
|
[ -n "$helper" ] && helpers+=("$helper")
|
||||||
|
done < <(git config --global --get-all credential.helper || true)
|
||||||
|
|
||||||
|
printf 'Global git config\n'
|
||||||
|
printf ' user.name %s\n' "${name:-<unset>}"
|
||||||
|
printf ' user.email %s\n' "${email:-<unset>}"
|
||||||
|
printf ' core.editor %s\n' "${editor:-<unset>}"
|
||||||
|
|
||||||
|
if [ "${#helpers[@]}" -eq 0 ]; then
|
||||||
|
printf ' credential.helper %s\n' '<unset>'
|
||||||
|
else
|
||||||
|
printf ' credential.helper %s\n' "${helpers[0]}"
|
||||||
|
if [ "${#helpers[@]}" -gt 1 ]; then
|
||||||
|
local index
|
||||||
|
for (( index=1; index<${#helpers[@]}; index++ )); do
|
||||||
|
printf ' %s\n' "${helpers[$index]}"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
case "${1:-show}" in
|
||||||
|
show)
|
||||||
|
show_config
|
||||||
|
;;
|
||||||
|
editor)
|
||||||
|
set_editor "${2:-code}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
usage >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -18,6 +18,7 @@ fi
|
|||||||
export PATH="$HOME/.opencode/bin:$PATH"
|
export PATH="$HOME/.opencode/bin:$PATH"
|
||||||
export OPENCHAMBER_HOST="${OPENCHAMBER_HOST:-0.0.0.0}"
|
export OPENCHAMBER_HOST="${OPENCHAMBER_HOST:-0.0.0.0}"
|
||||||
export VAULT_ADDR="${VAULT_ADDR:-http://192.168.30.53:8200}"
|
export VAULT_ADDR="${VAULT_ADDR:-http://192.168.30.53:8200}"
|
||||||
|
export PLANNOTATOR_REMOTE="${PLANNOTATOR_REMOTE:-1}"
|
||||||
export PLANNOTATOR_PORT="${PLANNOTATOR_PORT:-9999}"
|
export PLANNOTATOR_PORT="${PLANNOTATOR_PORT:-9999}"
|
||||||
|
|
||||||
# Derived environment variables that may depend on machine-local secrets.
|
# Derived environment variables that may depend on machine-local secrets.
|
||||||
@@ -27,3 +28,6 @@ export PLANNOTATOR_PORT="${PLANNOTATOR_PORT:-9999}"
|
|||||||
[ -n "${AZURE_OPENAI_API_KEY:-}" ] && export FOUNDRY_ANTHROPIC_API_KEY="$AZURE_OPENAI_API_KEY"
|
[ -n "${AZURE_OPENAI_API_KEY:-}" ] && export FOUNDRY_ANTHROPIC_API_KEY="$AZURE_OPENAI_API_KEY"
|
||||||
[ -n "${AZURE_OPENAI_API_KEY:-}" ] && export CHROMA_OPENAI_API_KEY="$AZURE_OPENAI_API_KEY"
|
[ -n "${AZURE_OPENAI_API_KEY:-}" ] && export CHROMA_OPENAI_API_KEY="$AZURE_OPENAI_API_KEY"
|
||||||
[ -n "${OUTLINE_MOKU_TOKEN:-}" ] && export OUTLINE_MOKU_AUTHORIZATION="Bearer $OUTLINE_MOKU_TOKEN"
|
[ -n "${OUTLINE_MOKU_TOKEN:-}" ] && export OUTLINE_MOKU_AUTHORIZATION="Bearer $OUTLINE_MOKU_TOKEN"
|
||||||
|
|
||||||
|
# bun completions
|
||||||
|
[ -s "/home/mangopig/.programming/node/bun/_bun" ] && source "/home/mangopig/.programming/node/bun/_bun"
|
||||||
|
|||||||
+21
@@ -213,12 +213,30 @@ fi
|
|||||||
|
|
||||||
export HISTORY_SUBSTRING_SEARCH_PREFIXED=1
|
export HISTORY_SUBSTRING_SEARCH_PREFIXED=1
|
||||||
|
|
||||||
|
zmodload zsh/terminfo 2>/dev/null || true
|
||||||
|
|
||||||
|
dotzsh_bind_if_present() {
|
||||||
|
local sequence="$1"
|
||||||
|
local widget="$2"
|
||||||
|
|
||||||
|
[ -n "$sequence" ] || return 0
|
||||||
|
bindkey "$sequence" "$widget"
|
||||||
|
}
|
||||||
|
|
||||||
# History keybindings
|
# History keybindings
|
||||||
bindkey '^[[A' history-substring-search-up
|
bindkey '^[[A' history-substring-search-up
|
||||||
bindkey '^[OA' history-substring-search-up
|
bindkey '^[OA' history-substring-search-up
|
||||||
bindkey '^[[B' history-substring-search-down
|
bindkey '^[[B' history-substring-search-down
|
||||||
bindkey '^[OB' history-substring-search-down
|
bindkey '^[OB' history-substring-search-down
|
||||||
|
|
||||||
|
# Word movement keybindings
|
||||||
|
dotzsh_bind_if_present "${terminfo[kLFT5]:-}" backward-word
|
||||||
|
dotzsh_bind_if_present "${terminfo[kRIT5]:-}" forward-word
|
||||||
|
bindkey '^[[1;5D' backward-word
|
||||||
|
bindkey '^[[1;5C' forward-word
|
||||||
|
bindkey '^[[5D' backward-word
|
||||||
|
bindkey '^[[5C' forward-word
|
||||||
|
|
||||||
# bun
|
# bun
|
||||||
export BUN_INSTALL="$PROG_DIR/node/bun"
|
export BUN_INSTALL="$PROG_DIR/node/bun"
|
||||||
case ":$PATH:" in
|
case ":$PATH:" in
|
||||||
@@ -233,3 +251,6 @@ case ":$PATH:" in
|
|||||||
*) export PATH="$PNPM_HOME:$PATH" ;;
|
*) export PATH="$PNPM_HOME:$PATH" ;;
|
||||||
esac
|
esac
|
||||||
# pnpm end
|
# pnpm end
|
||||||
|
|
||||||
|
# Allow Comments
|
||||||
|
setopt INTERACTIVE_COMMENTS
|
||||||
Reference in New Issue
Block a user