diff options
author | Thomas Deutschmann <whissi@gentoo.org> | 2020-01-01 23:21:56 +0100 |
---|---|---|
committer | Thomas Deutschmann <whissi@gentoo.org> | 2020-01-01 23:21:56 +0100 |
commit | b246a4aa6846c43791bff586c154877719f8830c (patch) | |
tree | e5bb10a4c052ceab081d179ba0f527c56478dcaf | |
parent | Add show action (diff) | |
download | eselect-rust-b246a4aa6846c43791bff586c154877719f8830c.tar.gz eselect-rust-b246a4aa6846c43791bff586c154877719f8830c.tar.bz2 eselect-rust-b246a4aa6846c43791bff586c154877719f8830c.zip |
Fix code style
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rw-r--r-- | rust.eselect.in | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/rust.eselect.in b/rust.eselect.in index 8e4ea3a..9de7149 100644 --- a/rust.eselect.in +++ b/rust.eselect.in @@ -1,4 +1,4 @@ -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 DESCRIPTION="Manage the Rust compiler versions" @@ -77,9 +77,11 @@ get_postfix() { get_current_target() { local i targets=( $(find_targets) ) for (( i = 0; i < ${#targets[@]}; i++ )); do - [[ rustc-$(get_postfix ${targets[i]}) = \ - $(basename "$(canonicalise "${BIN_DIR}/rustc")") ]] \ - && echo $i && return 0 + if [[ rustc-$(get_postfix ${targets[i]}) = \ + $(basename "$(canonicalise "${BIN_DIR}/rustc")") ]]; then + echo $i + return 0 + fi done echo "NOT_SET" } @@ -90,7 +92,7 @@ get_symlinks_from_file() { local symlinks=() local i if [[ -e ${filename} ]]; then - for i in `cat "${filename}"`; do + for i in $(cat "${filename}"); do symlinks+=($i) done fi @@ -193,8 +195,8 @@ set_version() { done cp "${ENV_D_PATH}/rust/provider-${target}" \ - "${ENV_D_PATH}/rust/last-set" || \ - die -q "symlink list copying failed" + "${ENV_D_PATH}/rust/last-set" \ + || die -q "symlink list copying failed" } ### cleanup action ### @@ -250,16 +252,16 @@ describe_set() { } describe_set_parameters() { - echo "<target>" + echo "<target>" } describe_set_options() { - echo "target : Target number (from 'list' action)" + echo "target : Target number (from 'list' action)" } do_set() { - [[ -z $1 ]] && die -q "You didn't tell me what to set the version to" - [[ $# -gt 1 ]] && die -q "Too many parameters" + [[ -z $1 ]] && die -q "You didn't tell me what to set the version to" + [[ $# -gt 1 ]] && die -q "Too many parameters" set_version "$1" || die -q "Couldn't set new active version" } |