Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#138] Properly scope path to exe file under temp directory #157

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,21 @@ jobs:
throw 'error on rg.exe'
}

- if: matrix.os == 'windows-latest'
name: "Integration test: [windows] [sync-marksman]"
env:
SYNC_DIR: "sync-marksman"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir $env:SYNC_DIR
cargo run -- --config="tests\$env:SYNC_DIR.toml" sync

ls -l $env:SYNC_DIR

if (!(Test-Path $env:SYNC_DIR\marksman.exe)) {
throw 'error on marksman.exe'
}

- if: matrix.os != 'windows-latest'
name: "Integration test: [unix] [sync-full]"
env:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ available [on GitHub][2].
Check prefetched `tool_assets` is not empty before passing
it to `SyncProgress::new`
(by [@zixuanzhang-x][zixuanzhang-x])
* [#138](https://github.com/chshersh/tool-sync/issues/138):
Windows executables that aren't in an archive are properly copied
(by [@binyomen][binyomen])


## [0.2.0] — 2022-09-20 🔃
Expand Down Expand Up @@ -142,6 +145,7 @@ Initial release prepared by [@chshersh][chshersh].
[mmohammadi9812]: https://github.com/mmohammadi9812
[zixuanzhang-x]: https://github.com/zixuanzhang-x
[crudiedo]: https://github.com/crudiedo
[binyomen]: https://github.com/binyomen

<!-- Header links -->

Expand Down
4 changes: 3 additions & 1 deletion src/sync/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ impl<'a> Archive<'a> {
pub fn unpack(&self) -> Result<PathBuf, UnpackError> {
match self.archive_type {
// already .exe file without archive (on Windows): no need to unpack
ArchiveType::Exe(exe_file) => Ok(PathBuf::from(exe_file)),
ArchiveType::Exe(exe_file) => {
Ok([self.tmp_dir, Path::new(exe_file)].into_iter().collect())
}

// unpack .tar.gz archive
ArchiveType::TarGz(asset_name) => {
Expand Down
6 changes: 6 additions & 0 deletions tests/sync-marksman.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
store_directory = "sync-marksman"

[marksman]
owner = 'artempyanykh'
repo = 'marksman'
asset_name.windows = 'marksman.exe'