Skip to content

Commit 1d614f9

Browse files
committed
use capture3 instead of popen3
1 parent a4ea56b commit 1d614f9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/arduino_ci/host.rb

+9-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,15 @@ def self.symlink(old_path, new_path)
5151
stdout, stderr, exitstatus = Open3.capture3('cmd.exe', "/c mklink /D #{new_path} #{old_path}")
5252
STDERR.puts stdout
5353
STDERR.puts stderr
54-
exitstatus
54+
return exitstatus if new_path.exist?
55+
56+
STDERR.puts "initial try failed, trying elevated"
57+
58+
stdout, stderr, exitstatus = Open3.capture3('runas.exe', "/user:administrator", "cmd /C mklink /D #{new_path} #{old_path}")
59+
60+
STDERR.puts stdout
61+
STDERR.puts stderr
62+
return exitstatus
5563
end
5664
end
5765
end

0 commit comments

Comments
 (0)