mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-12-29 07:34:11 +08:00
Fix installation bug.
If the install script is run from an alternative directory the use of pwd incorrectly sets the path to .zsh-autosuggesionsrc
This commit is contained in:
parent
03c5a52a89
commit
c54c2415f0
|
@ -4,6 +4,7 @@
|
||||||
DESCRIPTION="this script adds/removes a
|
DESCRIPTION="this script adds/removes a
|
||||||
.zsh-autosuggestionsrc reference to your .zshrc file."
|
.zsh-autosuggestionsrc reference to your .zshrc file."
|
||||||
ZSHRC=""
|
ZSHRC=""
|
||||||
|
PATH_TO_RC="source $HOME/.zsh-autosuggestions/.zsh-autosuggestionsrc"
|
||||||
|
|
||||||
function usage()
|
function usage()
|
||||||
{
|
{
|
||||||
|
@ -16,7 +17,7 @@ function usage()
|
||||||
|
|
||||||
function install()
|
function install()
|
||||||
{
|
{
|
||||||
PATH_TO_RC="source "$(pwd)"/.zsh-autosuggestionsrc"
|
|
||||||
# check if line exists in zshrc, add it if missing
|
# check if line exists in zshrc, add it if missing
|
||||||
if grep -Fxq "$PATH_TO_RC" "$ZSHRC"
|
if grep -Fxq "$PATH_TO_RC" "$ZSHRC"
|
||||||
then
|
then
|
||||||
|
@ -31,7 +32,6 @@ function install()
|
||||||
|
|
||||||
function uninstall()
|
function uninstall()
|
||||||
{
|
{
|
||||||
PATH_TO_RC="source "$(pwd)"/.zsh-autosuggestionsrc"
|
|
||||||
# check if line exists in zshrc, remove if preset
|
# check if line exists in zshrc, remove if preset
|
||||||
if grep -Fxq "$PATH_TO_RC" "$ZSHRC"
|
if grep -Fxq "$PATH_TO_RC" "$ZSHRC"
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in New Issue
Block a user