From 98b48015486bc638ba8f989af9285b73c413f9e6 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Wed, 17 Nov 2021 12:35:23 +0100 Subject: fix(bundler): use BUNDLE_JOBS in `bi` to avoid config file change When calling `bundle install` with `--jobs=`, bundle persists this argument in `.bundle/config`. If we run `BUNDLE_JOBS= bundle install` instead, this is not persisted. Fixes #10425 --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/bundler') diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 6293dc28a..c93d4869e 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -40,7 +40,7 @@ bundle_install() { else local cores_num="$(nproc)" fi - bundle install --jobs="$cores_num" "$@" + BUNDLE_JOBS="$cores_num" bundle install "$@" } ## Gem wrapper -- cgit v1.2.3-70-g09d2 From 15fd9c84deae400ba52451d75548fb8f6ec26bcf Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Tue, 9 Nov 2021 15:07:09 +0100 Subject: style(bundler): simplify `bundled_commands` array operations --- plugins/bundler/bundler.plugin.zsh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'plugins/bundler') diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index c93d4869e..c1cbb13dd 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -81,14 +81,12 @@ bundled_commands=( ) # Remove $UNBUNDLED_COMMANDS from the bundled_commands list -for cmd in $UNBUNDLED_COMMANDS; do - bundled_commands=(${bundled_commands#$cmd}); -done +bundled_commands=(${bundled_commands:|UNBUNDLED_COMMANDS}) +unset UNBUNDLED_COMMANDS # Add $BUNDLED_COMMANDS to the bundled_commands list -for cmd in $BUNDLED_COMMANDS; do - bundled_commands+=($cmd); -done +bundled_commands+=($BUNDLED_COMMANDS) +unset BUNDLED_COMMANDS # Check if in the root or a subdirectory of a bundled project _within-bundled-project() { @@ -126,5 +124,4 @@ for cmd in $bundled_commands; do compdef "_$cmd" "bundled_$cmd"="$cmd" fi done - unset cmd bundled_commands -- cgit v1.2.3-70-g09d2