Skip to content

Commit

Permalink
style(utils): Rearrange functions lexically
Browse files Browse the repository at this point in the history
  • Loading branch information
musq committed Jul 27, 2019
1 parent cb04aae commit 3003969
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/os/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,23 @@ cmd_exists() {

}

containsElement () {

# Check if a bash array contains a value
# https://stackoverflow.com/a/8574392

local e match="$1"
shift

for e; do
[[ "$e" == "$match" ]] \
&& return 0;
done

return 1

}

create_symlink() {

local -r sourceFile="$1"
Expand Down Expand Up @@ -170,23 +187,6 @@ get_answer() {
printf "%s" "$REPLY"
}

containsElement () {

# Check if a bash array contains a value
# https://stackoverflow.com/a/8574392

local e match="$1"
shift

for e; do
[[ "$e" == "$match" ]] \
&& return 0;
done

return 1

}

get_os() {

local os=""
Expand Down

0 comments on commit 3003969

Please sign in to comment.