We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 56a4b81 commit 82fd9caCopy full SHA for 82fd9ca
lib/pwsh/util.rb
@@ -7,14 +7,12 @@ module Util
7
module_function
8
9
# Verifies whether or not the current context is running on a Windows node.
10
+ # Implementation copied from `facets`: https://github.com/rubyworks/facets/blob/main/lib/standard/facets/rbconfig.rb
11
#
12
# @return [Bool] true if on windows
13
def on_windows?
- # Ruby only sets File::ALT_SEPARATOR on Windows and the Ruby standard
14
- # library uses that to test what platform it's on.
15
- require 'rbconfig'
16
- is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)
17
- !!is_windows
+ host_os = RbConfig::CONFIG['host_os']
+ !!(host_os =~ /mswin|mingw/)
18
end
19
20
# Verify paths specified are valid directories which exist.
0 commit comments