diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2019-11-22 02:14:25 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2019-11-22 11:13:34 +0530 |
commit | 1cca9e4b72b106374f203890b266f18609deefe3 (patch) | |
tree | 9f281f4b4de296c54d13dc9c7e214f58835636a7 /plugins/getplugs | |
parent | ee2dcb1de7d3e82b330f49ee9fb5dfd4608207ff (diff) | |
download | nnn-1cca9e4b72b106374f203890b266f18609deefe3.tar.gz |
shellcheck fixes
Diffstat (limited to 'plugins/getplugs')
-rwxr-xr-x | plugins/getplugs | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/plugins/getplugs b/plugins/getplugs index 34f599f..f7720a8 100755 --- a/plugins/getplugs +++ b/plugins/getplugs @@ -14,13 +14,13 @@ is_cmd_exists () { } merge () { - vimdiff $1 $2 + vimdiff "$1" "$2" } prompt () { - echo "Plugin $1 already exists and is different." - echo -n "Keep (k), merge (m), overwrite (o) [default: k]? " - read operation + printf "%s" "Plugin $1 already exists and is different.\n" + printf "Keep (k), merge (m), overwrite (o) [default: k]? " + read -r operation if [ "$operation" = "m" ]; then op="merge" @@ -40,27 +40,27 @@ else fi # backup any earlier plugins -if [ -d $PLUGIN_DIR ]; then - tar -C $CONFIG_DIR -czf $CONFIG_DIR"plugins-$(date '+%Y%m%d%H%M').tar.gz" plugins/ +if [ -d "$PLUGIN_DIR" ]; then + tar -C "$CONFIG_DIR" -czf "$CONFIG_DIR""plugins-$(date '+%Y%m%d%H%M').tar.gz" plugins/ fi -mkdir -p $PLUGIN_DIR -cd $CONFIG_DIR +mkdir -p "$PLUGIN_DIR" +cd "$CONFIG_DIR" || exit 1 curl -Ls -O https://github.com/jarun/nnn/archive/master.tar.gz tar -zxf master.tar.gz -cd nnn-master/plugins +cd nnn-master/plugins || exit 1 for f in *; do - if [ -f ../../plugins/$f ]; then - if [ "$(diff --brief $f ../../plugins/$f)" ]; then - prompt $f - $op $f ../../plugins/ + if [ -f ../../plugins/"$f" ]; then + if [ "$(diff --brief "$f" ../../plugins/"$f")" ]; then + prompt "$f" + $op "$f" ../../plugins/ fi else - cp -vRf $f ../../plugins/ + cp -vRf "$f" ../../plugins/ fi done -cd ../.. +cd ../.. || exit 1 $sucmd mv -vf nnn-master/misc/nlaunch/nlaunch /usr/local/bin/ -rm -rf nnn-master/ master.tar.gz $PLUGIN_DIR/README.md +rm -rf nnn-master/ master.tar.gz "$PLUGIN_DIR"/README.md |