refactor(config): migrate C2 autoexec call sites to self-identifying guard
This commit is contained in:
@@ -7,7 +7,10 @@
|
|||||||
# Source: docs/generate_component_registry.py
|
# Source: docs/generate_component_registry.py
|
||||||
|
|
||||||
set -g __fish_config_op_registry_keys \
|
set -g __fish_config_op_registry_keys \
|
||||||
|
__auto_source_fallback_venv: \
|
||||||
|
__fish_user_dots_link: \
|
||||||
agy: \
|
agy: \
|
||||||
|
auto-pull: \
|
||||||
bash: \
|
bash: \
|
||||||
cat: \
|
cat: \
|
||||||
claude: \
|
claude: \
|
||||||
@@ -27,7 +30,10 @@ set -g __fish_config_op_registry_keys \
|
|||||||
zoxide:
|
zoxide:
|
||||||
|
|
||||||
set -g __fish_config_op_registry_values \
|
set -g __fish_config_op_registry_values \
|
||||||
|
"autoexec/venv" \
|
||||||
|
"autoexec/sync" \
|
||||||
"aliases/dev-tools" \
|
"aliases/dev-tools" \
|
||||||
|
"autoexec/sync autoexec/sync" \
|
||||||
"aliases/shell-tools" \
|
"aliases/shell-tools" \
|
||||||
"aliases/filesystem" \
|
"aliases/filesystem" \
|
||||||
"aliases/dev-tools" \
|
"aliases/dev-tools" \
|
||||||
|
|||||||
@@ -14,8 +14,11 @@
|
|||||||
# Manage the registry with: auto-pull add / remove / list / status
|
# Manage the registry with: auto-pull add / remove / list / status
|
||||||
|
|
||||||
# C2 guard: when auto-execution is disabled, do not register the handler.
|
# C2 guard: when auto-execution is disabled, do not register the handler.
|
||||||
__fish_config_op_enabled __fish_config_op_autoexec; or exit
|
__fish_config_op_enabled (status basename); or exit
|
||||||
|
|
||||||
|
# COMPONENT
|
||||||
|
# autoexec/sync
|
||||||
|
#
|
||||||
# SYNOPSIS
|
# SYNOPSIS
|
||||||
# __auto_pull_on_pwd (event handler, --on-variable PWD)
|
# __auto_pull_on_pwd (event handler, --on-variable PWD)
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Copyright (C) 2026 Rootiest
|
# Copyright (C) 2026 Rootiest
|
||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
|
# COMPONENT
|
||||||
|
# autoexec/venv
|
||||||
|
#
|
||||||
# SYNOPSIS
|
# SYNOPSIS
|
||||||
# __auto_source_fallback_venv
|
# __auto_source_fallback_venv
|
||||||
#
|
#
|
||||||
@@ -16,7 +19,7 @@ function __auto_source_fallback_venv --on-variable PWD
|
|||||||
status --is-command-substitution; and return
|
status --is-command-substitution; and return
|
||||||
|
|
||||||
# Opinionated guard (C2): no automatic venv activation when disabled.
|
# Opinionated guard (C2): no automatic venv activation when disabled.
|
||||||
__fish_config_op_enabled __fish_config_op_autoexec; or return
|
__fish_config_op_enabled (status current-function); or return
|
||||||
|
|
||||||
# 1. Skip if direnv is already managing this directory
|
# 1. Skip if direnv is already managing this directory
|
||||||
if set -q DIRENV_DIR; or test -e ".envrc"
|
if set -q DIRENV_DIR; or test -e ".envrc"
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Copyright (C) 2026 Rootiest
|
# Copyright (C) 2026 Rootiest
|
||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
|
# COMPONENT
|
||||||
|
# autoexec/sync
|
||||||
|
#
|
||||||
# SYNOPSIS
|
# SYNOPSIS
|
||||||
# __fish_user_dots_link
|
# __fish_user_dots_link
|
||||||
#
|
#
|
||||||
@@ -41,7 +44,7 @@ function __fish_user_dots_link --description 'Manage the user-dots convenience s
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Enabled: creation is a C2 startup side-effect.
|
# Enabled: creation is a C2 startup side-effect.
|
||||||
__fish_config_op_enabled __fish_config_op_autoexec; or return 0
|
__fish_config_op_enabled (status current-function); or return 0
|
||||||
|
|
||||||
test -d "$__fish_user_dots_path"; or return 0
|
test -d "$__fish_user_dots_path"; or return 0
|
||||||
if test -L "$link"
|
if test -L "$link"
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
# CATEGORY
|
# CATEGORY
|
||||||
# 04-git-and-version-control
|
# 04-git-and-version-control
|
||||||
#
|
#
|
||||||
|
# COMPONENT
|
||||||
|
# autoexec/sync
|
||||||
|
#
|
||||||
# SYNOPSIS
|
# SYNOPSIS
|
||||||
# auto-pull [list]
|
# auto-pull [list]
|
||||||
# auto-pull add [PATH]
|
# auto-pull add [PATH]
|
||||||
@@ -136,7 +139,7 @@ function auto-pull --description 'Manage the auto-pull repository registry'
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
case status
|
case status
|
||||||
if __fish_config_op_enabled __fish_config_op_autoexec
|
if __fish_config_op_enabled (status current-function)
|
||||||
echo "$c_ok""auto-pull: ENABLED$c_reset $c_dim(C2 auto-execution on)$c_reset"
|
echo "$c_ok""auto-pull: ENABLED$c_reset $c_dim(C2 auto-execution on)$c_reset"
|
||||||
else
|
else
|
||||||
echo "$c_warn""auto-pull: DISABLED$c_reset $c_dim(via __fish_config_op_autoexec)$c_reset"
|
echo "$c_warn""auto-pull: DISABLED$c_reset $c_dim(via __fish_config_op_autoexec)$c_reset"
|
||||||
|
|||||||
Reference in New Issue
Block a user