Skip to content

Just my personal project for modularizing my bash profile and getting it to a standardized and portable state"

License

Notifications You must be signed in to change notification settings

dwayn/modular_bash_profile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modular Bash Profile

Setup

Root bash profile script that should be sourced from your automatically sourced profile file. In my personal experience .bash_profile seems to be the most broadly compatible with various terminals (both independent and embedded, eg: VS Code).

  • ~/.bash_profile
  • ~/.profile
  • ~/.bashrc

Add this line to whichever profile file from above you use (pro tip, provide an absolute path using $HOME or other path variables that expand to an absolute path to ensure best compatibility with various terminals)

source /path/to/modular_bash_profile/modular_profile_loader.sh

Managing Modules

  • modular_bash_list - Lists all the modules that can be enabled
  • modular_bash_enable <module-name> - Enables a module by symlinking it in the enabled directory
  • modular_bash_disable <module-name> - Disagles a module by removing its symlink in the enabled directory
  • modular_bash_reload - Sources all of the enabled modules in proper order
  • modular_bash_rename <old-module-name> <new-module-name> - Safely renames a module while retaining whether it is enabled or not
  • modular_bash_priority <module-name> <priority> - Change the priority of a module, handles renaming module and any symlinks to reflect the priority change

All of the commands that take a module-name can take just the module name from the global or local modules list, or can take local/<module-name> or global/<module-name> to explicitly reference the module you wish to target.

Adding Custom Modules

Modules

Modules in here should not contain anything that is single environment specific or that is private. New modules here should be for things like application/utility/setup things.

Local

This is the place to put anything specifically personal to the local environment it is running on or anything that is private info (credentials/keys/etc).

About

Just my personal project for modularizing my bash profile and getting it to a standardized and portable state"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published