You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following function takes ~100 seconds to copy the SDK (~385 files and 94MB). On Linux the whole test is finished in 3 seconds.
copy_directory --source/string --target/string:
directory.mkdir --recursive target
source = source.replace --all "\\" "/"
target = target.replace --all "\\" "/"
// We are using `tar` so we keep the permissions.
tar := tool_path_ "tar"
from := pipe.from [tar, "c", "-f", "-", "-C", source, "."]
to := pipe.to [tar, "x", "-f", "-", "-C", target]
writer := writer.Writer to
while chunk := from.read:
writer.write chunk
from.close
to.close
tool_path_ function
tool_path_ tool/string -> string:
if platform != PLATFORM_WINDOWS: return tool
// On Windows, we use the <tool>.exe that comes with Git for Windows.
// TODO(florian): depending on environment variables is brittle.
// We should use `SearchPath` (to find `git.exe` in the PATH), or
// 'SHGetSpecialFolderPath' (to find the default 'Program Files' folder).
program_files_path := os.env.get "ProgramFiles"
if not program_files_path:
// This is brittle, as Windows localizes the name of the folder.
program_files_path = "C:/Program Files"
result := "$program_files_path/Git/usr/bin/$(tool).exe"
if not file.is_file result:
throw "Could not find $result. Please install Git for Windows"
return result
The text was updated successfully, but these errors were encountered:
The following function takes ~100 seconds to copy the SDK (~385 files and 94MB). On Linux the whole test is finished in 3 seconds.
tool_path_ function
The text was updated successfully, but these errors were encountered: