ruby-shell 2.10.0 → 2.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/rsh +27 -15
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee2ef357d1196f43811ad6974313bbdb057f61cf90219146936f70a2ec6f16bb
|
4
|
+
data.tar.gz: 85540ca12677d88d6b2fb6999f17ce871b7c5142f20a0fa14e03685f82f41853
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7a35b051b9d768cb2065e6308eecc030f3b153a31881b31e25813a377de06ea98b5e76f55233dbc0ae1ec30920091ee62817352f43fc5645c3a3d69db746c78
|
7
|
+
data.tar.gz: f8aeb41fa3870b02d96b111126c1770fb74e235a01847947937461c1a697195e3fc6152eb5a45a147c1703278e12a1b8dc5c279e1c1e4b51d81fbeb0672ed27f
|
data/bin/rsh
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
# Web_site: http://isene.com/
|
9
9
|
# Github: https://github.com/isene/rsh
|
10
10
|
# License: Public domain
|
11
|
-
@version = "2.
|
11
|
+
@version = "2.10.1" # Bug fix: Improved && operator logic for proper conditional execution
|
12
12
|
|
13
13
|
# MODULES, CLASSES AND EXTENSIONS
|
14
14
|
class String # Add coloring to strings (with escaping for Readline)
|
@@ -865,27 +865,39 @@ end
|
|
865
865
|
def execute_conditional(cmd_line)
|
866
866
|
# Split on && and || while preserving the operators
|
867
867
|
parts = cmd_line.split(/(\s*&&\s*|\s*\|\|\s*)/)
|
868
|
-
|
869
|
-
result =
|
868
|
+
|
869
|
+
result = nil # Start with nil to handle first command
|
870
870
|
i = 0
|
871
|
+
|
871
872
|
while i < parts.length
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
873
|
+
part = parts[i].strip
|
874
|
+
i += 1
|
875
|
+
next if part.empty?
|
876
|
+
|
877
|
+
if part == '&&'
|
878
|
+
# If previous command failed, skip the rest until we find || or end
|
879
|
+
unless result
|
880
|
+
while i < parts.length && parts[i].strip != '||'
|
881
|
+
i += 1
|
882
|
+
end
|
883
|
+
end
|
884
|
+
elsif part == '||'
|
885
|
+
# If previous command succeeded, skip the rest until we find && or end
|
886
|
+
if result
|
887
|
+
while i < parts.length && parts[i].strip != '&&'
|
888
|
+
i += 1
|
889
|
+
end
|
890
|
+
end
|
881
891
|
else
|
882
892
|
# Execute the command
|
883
|
-
success = system(
|
893
|
+
success = system(part)
|
884
894
|
result = success
|
885
|
-
|
895
|
+
@last_exit = $?.exitstatus
|
896
|
+
puts " Command failed: #{part} (exit #{@last_exit})" unless success
|
886
897
|
end
|
887
|
-
i += 1
|
888
898
|
end
|
899
|
+
|
900
|
+
result
|
889
901
|
end
|
890
902
|
def expand_braces(str)
|
891
903
|
# Simple brace expansion: {a,b,c} -> a b c
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-shell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.10.
|
4
|
+
version: 2.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-09-
|
11
|
+
date: 2025-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'A shell written in Ruby with extensive tab completions, aliases/nicks,
|
14
14
|
history, syntax highlighting, theming, auto-cd, auto-opening files and more. UPDATE
|