From 20fc2e210a2a6862f9482793d94c48af7cb25c08 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Wed, 10 Nov 2021 21:00:57 +0800 Subject: [PATCH] fix: some small bugs --- cli/nnn.sh | 5 ++--- devel/go.sh | 2 ++ gui/pass.sh | 23 ++++++++++++----------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/cli/nnn.sh b/cli/nnn.sh index a27f0fb..1de1da8 100755 --- a/cli/nnn.sh +++ b/cli/nnn.sh @@ -6,7 +6,7 @@ DIR=$(dirname "$(readlink -f "$0")") log 'Setting up nnn' -$NNN_CONFIG_DIR="$XDG_CONFIG_HOME/nnn/plugins" +NNN_CONFIG_DIR="$XDG_CONFIG_HOME/nnn" # setup package mirror for CHINA case "$PM" in @@ -19,13 +19,12 @@ case "$PM" in rm -rf nnn.tar.gz cd - - mkdir -p "$NNN_CONFIG_DIR" + mkdir -p "$NNN_CONFIG_DIR/plugins" HTTPS_PROXY=$GITHUB_PROXY curl -Lo "$NNN_CONFIG_DIR/plugins/fzcd" https://github.com/jarun/nnn/raw/master/plugins/fzcd HTTPS_PROXY=$GITHUB_PROXY curl -Lo "$NNN_CONFIG_DIR/plugins/preview-tui" https://github.com/jarun/nnn/raw/master/plugins/preview-tui ;; pacman) sudo pacman -S --noconfirm --needed nnn - yay -S --noconfirm --needed dragon-drag-and-drop cp -r /usr/share/nnn/plugins/. "$NNN_CONFIG_DIR" esac diff --git a/devel/go.sh b/devel/go.sh index 96184a3..09d24a0 100755 --- a/devel/go.sh +++ b/devel/go.sh @@ -6,6 +6,7 @@ DIR=$(dirname "$(readlink -f "$0")") log "Setting up go" # install go +if ! has_cmd go; then case "$PM" in pkg) pkg install golang -y @@ -19,6 +20,7 @@ case "$PM" in go ;; esac +fi if in_china; then go env -w GO111MODULE=on diff --git a/gui/pass.sh b/gui/pass.sh index 25eaec0..ad38f3d 100755 --- a/gui/pass.sh +++ b/gui/pass.sh @@ -42,15 +42,14 @@ EOF # install browserpass-native +intorepo https://github.com/browserpass/browserpass-native.git "$DIR/repos/browserpass-native" +make configure +make +sudo make install +exitrepo if [ -n "$WSL" ]; then echo "Please download browserpass-native for windows 64 and extract it to /usr/local/bin" x-open https://github.com/browserpass/browserpass-native/releases/latest -else - intorepo https://github.com/browserpass/browserpass-native.git "$DIR/repos/browserpass-native" - make configure - make - sudo make install - exitrepo fi # enable browser-native for google-chrome @@ -60,11 +59,13 @@ fi # chrome extension: https://chrome.google.com/webstore/detail/browserpass/naepdomgkenhinolocfifgehidddafch # enable browserpass for browsers -cd /usr/lib/browserpass -has_cmd chromium && make hosts-chromium-user -has_cmd firefox && make hosts-firefox-user -has_cmd google-chrome && make hosts-chrome-user -cd - +if [ -f /usr/lib/browserpass ]; then + cd /usr/lib/browserpass + has_cmd chromium && make hosts-chromium-user + has_cmd firefox && make hosts-firefox-user + has_cmd google-chrome && make hosts-chrome-user + cd - +fi # android # [OpenKeyChain - encryption/decryption](https://f-droid.org/packages/org.sufficientlysecure.keychain/)