mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 09:12:35 +00:00
Compare commits
2 Commits
ce10cdc658
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| d92a8753d8 | |||
| b299593076 |
@@ -117,6 +117,7 @@ class W3DHub
|
|||||||
return "#{base_path}/#{path}" if W3DHub.windows? # Windows is easy, or annoying, depending how you look at it...
|
return "#{base_path}/#{path}" if W3DHub.windows? # Windows is easy, or annoying, depending how you look at it...
|
||||||
|
|
||||||
constructed_path = base_path
|
constructed_path = base_path
|
||||||
|
lowercase_full_path = "#{base_path}/#{path}".downcase.strip.freeze
|
||||||
|
|
||||||
accepted_parts = 0
|
accepted_parts = 0
|
||||||
split_path = path.split("/")
|
split_path = path.split("/")
|
||||||
@@ -124,15 +125,17 @@ class W3DHub
|
|||||||
Dir.glob("#{constructed_path}/*").each do |part|
|
Dir.glob("#{constructed_path}/*").each do |part|
|
||||||
next unless "#{constructed_path}/#{segment}".downcase == part.downcase
|
next unless "#{constructed_path}/#{segment}".downcase == part.downcase
|
||||||
|
|
||||||
|
# Handle edge case where a file with the same name is in a higher directory
|
||||||
|
next if File.file?(part) && part.downcase.strip != lowercase_full_path
|
||||||
|
|
||||||
constructed_path = part
|
constructed_path = part
|
||||||
accepted_parts += 1
|
accepted_parts += 1
|
||||||
|
break
|
||||||
break if File.file?(constructed_path)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Find file if it exists else use provided path as cased
|
# Find file if it exists else use provided path as cased
|
||||||
if "#{base_path}/#{path}".length == constructed_path.length
|
if constructed_path.downcase.strip == lowercase_full_path
|
||||||
constructed_path
|
constructed_path
|
||||||
elsif accepted_parts.positive?
|
elsif accepted_parts.positive?
|
||||||
"#{constructed_path}/#{split_path[accepted_parts..].join('/')}"
|
"#{constructed_path}/#{split_path[accepted_parts..].join('/')}"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class W3DHub
|
class W3DHub
|
||||||
DIR_NAME = "W3DHubAlt"
|
DIR_NAME = "W3DHubAlt".freeze
|
||||||
VERSION = "0.8.0"
|
VERSION = "0.8.1".freeze
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user