Open binyomen opened 1 year ago
@binyomen That sounds like a good idea! tool-sync
already supports .exe
executables on Windows that aren't in the archive.
But it makes sense to support them from other platforms as well 🙂
Huh, weird, that doesn't seem to work for me. With the config:
store_directory = '~/bin'
[marksman]
owner = 'artempyanykh'
repo = 'marksman'
asset_name.windows = 'marksman.exe'
I get the output:
🔄 All done!
📦 Estimated total download size: 16.93 MiB
⛔ marksman 2022-09-13 [error] The system cannot find the file specified. (os error 2) ✨ Successfully installed 0 tools!
📁 Installation directory: C:\Users\beweedon/bin
This is on Windows 11 and tool-sync version 0.2.0.
@binyomen Huh, that is weird. I'd expect this work. I don't have access to Windows so I would start debugging this issue by adding a test for downloading marksman
similar to the ripgrep
one:
At this point, I'm not even sure where exactly this is coming from so a better investigation is required 🕵🏻
Thanks for the tip! I'll have a look at this when I get the chance!
somehow changing copy_file
argument copies the exe correctly:
Ok(_tool_path) => {
copy_file(
download_info.archive_path,
self.store_directory,
&tool_asset.exe_name,
)?;
and ~it still extracts+copies the native-support executables~. we need to branch this based on ArchiveType, i think.
Some types in sync
modules can implement Debug
to ease printing them out for investigating.
It looks like the issue is that for marksman for example, the path passed to copy_file
is just marksman.exe
rather than the whole path (for tool
it's C:\Users\binyomen\AppData\Local\Temp\tool-sync.AeusgFEbnvL2\tool.exe
).
I'm working on a fix now.
I'm thinking this would be useful for repos like marksman which store the executables as top-level assets rather than in archives.
Thanks! I was about to make this tool myself when I saw someone had just recently started it!