mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-02-14 17:49:53 +00:00
lint(sh): removed redundant [ around if blocks (fix #500, SC2143)
This commit is contained in:
@@ -4,7 +4,7 @@ pkg_install() {
|
||||
(
|
||||
cd "$WEBI_TMP" 2>&1 > /dev/null
|
||||
|
||||
if [ -n "$(command -v rsync 2> /dev/null | grep rsync)" ]; then
|
||||
if command -v rsync 2> /dev/null | grep -q rsync; then
|
||||
rsync -Krl ./xmpl*/ "$pkg_src/" 2> /dev/null
|
||||
else
|
||||
cp -Hr ./xmpl*/* "$pkg_src/" 2> /dev/null
|
||||
|
||||
@@ -7,7 +7,7 @@ _install_brew() {
|
||||
# Straight from https://brew.sh
|
||||
#/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
|
||||
|
||||
if [ -n "$(uname -a | grep -i darwin)" ]; then
|
||||
if uname -a | grep -q -i darwin; then
|
||||
needs_xcode="$(/usr/bin/xcode-select -p > /dev/null 2> /dev/null || echo "true")"
|
||||
if [ -n "${needs_xcode}" ]; then
|
||||
echo ""
|
||||
|
||||
@@ -5,7 +5,7 @@ set -u
|
||||
__init_git() {
|
||||
|
||||
if [ -z "$(command -v git)" ]; then
|
||||
if [ -n "$(uname -a | grep -i darwin)" ]; then
|
||||
if uname -a | grep -q -i darwin; then
|
||||
echo >&2 "Error: 'git' not found. You may have to re-install 'git' on Mac after every major update."
|
||||
echo >&2 " for example, try: xcode-select --install"
|
||||
# sudo xcodebuild -license accept
|
||||
|
||||
@@ -6,7 +6,7 @@ __init_pyenv() {
|
||||
|
||||
curl -fsSL https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
|
||||
|
||||
if [ ! -f ~/.bashrc ] || [ -z "$(grep 'pyenv init' ~/.bashrc)" ]; then
|
||||
if [ ! -f ~/.bashrc ] || ! grep -q 'pyenv init' ~/.bashrc; then
|
||||
echo '' >> ~/.bashrc
|
||||
echo '# added by Webi for pyenv' >> ~/.bashrc
|
||||
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
|
||||
@@ -15,7 +15,7 @@ __init_pyenv() {
|
||||
|
||||
if [ -n "$(command -v zsh)" ]; then
|
||||
touch ~/.zshrc
|
||||
if [ -z "$(grep 'pyenv init' ~/.zshrc)" ]; then
|
||||
if ! grep -q 'pyenv init' ~/.zshrc; then
|
||||
echo '' >> ~/.zshrc
|
||||
echo '# added by Webi for pyenv' >> ~/.zshrc
|
||||
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
|
||||
@@ -26,7 +26,7 @@ __init_pyenv() {
|
||||
if [ -n "$(command -v fish)" ]; then
|
||||
mkdir -p ~/.config/fish
|
||||
touch ~/.config/fish/config.fish
|
||||
if [ -z "$(grep 'pyenv init' ~/.config/fish/config.fish)" ]; then
|
||||
if ! grep -q 'pyenv init' ~/.config/fish/config.fish; then
|
||||
echo '' >> ~/.config/fish/config.fish
|
||||
echo '# added by Webi for pyenv' >> ~/.config/fish/config.fish
|
||||
echo 'status is-login; and pyenv init --path | source' >> ~/.config/fish/config.fish
|
||||
|
||||
Reference in New Issue
Block a user