Skip to content

feat: Add guard to ignore empty lines and show warning if there is any #422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,21 @@ install_default_npm_packages() {
}

local args=()

local line="" aux=()
local printed_empty_lines_warn=0
while read -r line; do
pkg_lines+=("$line")
if [[ -z "$line" ]]; then
# Ignore empty lines and print warning
if [ "$printed_empty_lines_warn" -eq 0 ]; then
echo "$(colored $YELLOW WARNING:) There are empty line ${pkgs_file}"
printed_empty_lines_warn=1
fi

continue
fi

pkg_lines+=("$line")

case "$line" in
*' -'*|-*)
# Installing previously read packages
Expand Down