2.0 KiB
2.0 KiB
title, description, weight
| title | description | weight |
|---|---|---|
| System Initialization | Repository setup, Git hooks, and PATH configuration. | 51 |
The Root framework requires a one-time initialization on each host to establish path linkages and repository-level configurations.
The init.sh Script
The init.sh script located at the repository root is the primary bootstrap mechanism. It performs the following critical tasks:
- Submodule Initialization: Ensures the Commons repository is present and up to date.
- Git Hook Configuration: Points
core.hooksPathto.operator/shared/githooksto enable standardized pre-commit checks. - Safe Directory Registration: Adds the repository to Git's
safe.directorylist, which is required for operations performed by different users (e.g.,root,adam). - Vim Configuration: Links a standardized
.vimrcto both the current user and therootuser for a consistent editing experience. - PATH Persistence: Adds the
.operator/shared/scripts/rundirectory to the user's~/.bashrc, making therootcommand available globally.
Git Hooks
Root enforces standards through Git hooks stored in .operator/shared/githooks/.
- Pre-commit: Validates that all scripts follow the namespacing and structure conventions.
- Commit-msg: (Optional) Enforces conventional commit messages if configured.
PATH Configuration
The root command is a wrapper located in .operator/shared/scripts/run/root. By adding this directory to the PATH, the dispatcher can be invoked from any directory within the system, automatically resolving the repository root based on the current working directory or environment variables.
# Example of manual PATH addition (performed automatically by init.sh)
export PATH="$HOME/repo/.operator/shared/scripts/run:$PATH"
See also: