-
Notifications
You must be signed in to change notification settings - Fork 1
Refactor shell configuration for improved function loading order and modularity #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… modularity Fixes #31 - Moving to path_functions from bash_aliases beginning functions. - Order: path_functions -> common_env -> bash_aliases
…lude additional dotfiles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Refactors shell configuration to improve modularity by extracting path utilities, optimizing load order, and updating installation/symlink logic.
- Extracts utility functions into
path_functionsand updates*.rcfiles to source it beforecommon_envandbash_aliases - Updates
install.shandMakefileto handle newpath_functions(and ensurecommon_env) dotfile symlinking - Removes redundant eza alias fallback logic in
bash_aliases
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| zshrc | Updated load order comments and sources for new modules |
| path_functions | New file containing shared path and system detection funcs |
| install.sh | Added path_functions (and conditional common_env) setup in dotfiles; improved symlink logic |
| bashrc | Reordered sourcing to match zshrc pattern |
| bash_aliases | Removed duplicated utility functions and obsolete eza fallback |
| Makefile | Enhanced symlink rule with existence and conflict checks |
Comments suppressed due to low confidence (3)
path_functions:43
- There's a typo in the function name 'is_codepsaces'; it should be 'is_codespaces' to match the intended feature and avoid confusion.
function is_codepsaces { test -n "$CODESPACES" && test "$CODESPACES" = true ; }
install.sh:206
- The
~/.common_envfile is sourced twice inappend-codespaces-bashrc; remove this duplicate to prevent redundant loading and potential side effects.
source_if_readable ~/.common_env
install.sh:249
- Duplicate sourcing of
~/.common_envinappend-codespaces-zshrc; consider removing the second call to streamline the configuration.
source_if_readable ~/.common_env
🤖 💬 Copilot Chat Session : Problem (Japanese)## 問題点xtetsuji: 問題点現在、 if exists eza ; then
alias els='eza -F --color=auto --git '
alias etree='eza -F --color=auto --git --tree '
elif [ -x "/opt/homebrew/bin/eza" ]; then
# フォールバック: eza が PATH にないが Homebrew の場所に存在する場合
alias els='/opt/homebrew/bin/eza -F --color=auto --git'
alias etree='/opt/homebrew/bin/eza -F --color=auto --git --tree'
fi根本原因現状の読み込み順( 提案される解決策パス系ユーティリティ関数( この変更により、
修正対象ファイル
GitHub Copilot: この問題を解決するために、パス系ユーティリティ関数を別ファイルに抽出し、読み込み順序を修正します。まず現在のファイルの内容を確認してから、必要な変更を行います。 現在の状況を理解しました。bash_aliases にユーティリティ関数が定義されており、common_env でそれらを使用しているため、読み込み順が逆になっています。この問題を解決するため、以下の手順で修正を行います:
1.
|
Enhance the loading order of shell configuration files to eliminate redundant fallback logic for eza alias setup. Extract utility functions into a new file, ensuring logical dependencies are met. Update symlink creation in the Makefile and install script to handle additional dotfiles.
Fixes #31