Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fzf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
fzf
Commits
89687105
Commit
89687105
authored
9 years ago
by
Junegunn Choi
Browse files
Options
Downloads
Patches
Plain Diff
[install] Ask before updating shell configuration files
parent
74d1694b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
install
+19
-15
19 additions, 15 deletions
install
with
19 additions
and
15 deletions
install
+
19
−
15
View file @
89687105
...
...
@@ -7,7 +7,7 @@ set -u
auto_completion
=
key_bindings
=
update_config
=
1
update_config
=
2
binary_arch
=
help
()
{
...
...
@@ -335,8 +335,8 @@ fi
append_line
()
{
set
-e
local
skip
line file pat lno
skip
=
"
$1
"
local
update
line file pat lno
update
=
"
$1
"
line
=
"
$2
"
file
=
"
$3
"
pat
=
"
${
4
:-}
"
...
...
@@ -352,7 +352,7 @@ append_line() {
if
[
-n
"
$lno
"
]
;
then
echo
" - Already exists: line #
$lno
"
else
if
[
$
skip
-eq
1
]
;
then
if
[
$
update
-eq
1
]
;
then
echo
>>
"
$file
"
echo
"
$line
"
>>
"
$file
"
echo
" + Added"
...
...
@@ -364,6 +364,11 @@ append_line() {
set
+e
}
if
[
$update_config
-eq
2
]
;
then
echo
ask
"Do you want to update your shell configuration files?"
update_config
=
$?
fi
echo
for
shell
in
$shells
;
do
[
$shell
=
zsh
]
&&
dest
=
${
ZDOTDIR
:-
~
}
/.zshrc
||
dest
=
~/.bashrc
...
...
@@ -375,15 +380,14 @@ if [ $key_bindings -eq 1 ] && [ $has_fish -eq 1 ]; then
append_line
$update_config
"fzf_key_bindings"
"
$bind_file
"
fi
cat
<<
EOF
Finished. Restart your shell or reload config file.
source ~/.bashrc # bash
EOF
[
$has_zsh
-eq
1
]
&&
echo
" source
${
ZDOTDIR
:-
~
}
/.zshrc # zsh"
[
$has_fish
-eq
1
]
&&
echo
" fzf_key_bindings # fish"
;
cat
<<
EOF
Use uninstall script to remove fzf.
For more information, see: https://github.com/junegunn/fzf
EOF
if
[
$update_config
-eq
1
]
;
then
echo
'Finished. Restart your shell or reload config file.'
echo
' source ~/.bashrc # bash'
[
$has_zsh
-eq
1
]
&&
echo
" source
${
ZDOTDIR
:-
~
}
/.zshrc # zsh"
[
$has_fish
-eq
1
]
&&
[
$key_bindings
-eq
1
]
&&
echo
' fzf_key_bindings # fish'
echo
echo
'Use uninstall script to remove fzf.'
echo
fi
echo
'For more information, see: https://github.com/junegunn/fzf'
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment