mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-11-22 09:16:08 +08:00
Extracting template to a file and improving it
It's hard to read the template as it was being created using `echo` instead of being defined on a separate file. Also adding some comments to improve the configuration file readability.
This commit is contained in:
parent
5654170b93
commit
7c5e2b3964
|
@ -92,10 +92,8 @@ omf_install() {
|
|||
touch ${fish_config_file} >/dev/null 2>&1
|
||||
test ! -w ${fish_config_file} && die "Fish configuration file is not writable, aborting."
|
||||
|
||||
|
||||
echo "set -g OMF_PATH $(echo "${OMF_PATH}" | sed -e "s|$HOME|\$HOME|")" > ${fish_config_file}
|
||||
echo "set -g OMF_CONFIG $(echo "${OMF_CONFIG}" | sed -e "s|$HOME|\$HOME|")" >> ${fish_config_file}
|
||||
echo "source \$OMF_PATH/init.fish" >> ${fish_config_file}
|
||||
sed "s|{{OMF_PATH}}|$OMF_PATH|;s|{{OMF_CONFIG}}|$OMF_CONFIG|" \
|
||||
"${OMF_PATH}/templates/config.fish" > "${fish_config_file}"
|
||||
|
||||
if [ ! -d "${OMF_CONFIG}" ]; then
|
||||
echo "Writing Oh My Fish configuration → ${OMF_CONFIG}"
|
||||
|
|
13
templates/config.fish
Normal file
13
templates/config.fish
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Path to your oh-my-fish.
|
||||
set -g OMF_PATH {{OMF_PATH}}
|
||||
|
||||
# Path to your oh-my-fish configuration.
|
||||
set -g OMF_CONFIG {{OMF_CONFIG}}
|
||||
|
||||
### Configuration required to load oh-my-fish ###
|
||||
# Note: Only add configurations that are required to be set before oh-my-fish is loaded.
|
||||
# For common configurations, we advise you to add them to your $OMF_CONFIG/init.fish file or
|
||||
# to create a custom plugin instead.
|
||||
|
||||
# Load oh-my-fish configuration.
|
||||
source $OMF_PATH/init.fish
|
Loading…
Reference in New Issue
Block a user