Skip to content

fix: windows use powershell to extract zip file#2005

Merged
mistydemeo merged 13 commits intoaxodotdev:mainfrom
jacobtread:main
Aug 27, 2025
Merged

fix: windows use powershell to extract zip file#2005
mistydemeo merged 13 commits intoaxodotdev:mainfrom
jacobtread:main

Conversation

@jacobtread
Copy link
Contributor

Description

For windows platforms the unzip utility is not on systems by default, this changes it so that on windows powershell is used in combination with Expand-Archive to extract the zip file.

Changes

  • Extend "Package" to take in the platform
  • Add case in zip extraction for the windows platform to use powershell Expand-Archive instead of unzip

Related Issues

For windows platforms the unzip utility is not on systems by default, this changes it so that on windows powershell is used in combination with Expand-Archive to extract the zip file
@mistydemeo
Copy link
Contributor

Thank you very much! I appreciate this! I'll give it a test and see how it works.

It looks like prettier is flagging a couple of requested formatting changes. Are you up for tweaking that? I can take care of it if you prefer.

The snapshots we use for tests will need to be updated with these changes. I can do that for you if you'd like, or you can do it by following these steps:

  • Install cargo insta
  • Run the tests with cargo test
  • Run cargo insta accept
  • Commit and push the changes

@jacobtread
Copy link
Contributor Author

jacobtread commented Aug 5, 2025

Hi, I have updated the formatting :) I will need you to please handle the test snapshots updating I think If I run them on my device it will cause lots of problems, as running the tests on my machine ends up failing a majority of unrelated integration and snapshot tests (I'd assume because I'm using windows and the tests don't take that into account) thank you!

Edit: The errors I was getting might've just been me running from the top level project, running the tests and cargo insta accept from the cargo-dist sub directory got me more acceptable outputs, I've commited the new snapshots for this

@mistydemeo
Copy link
Contributor

Thanks! Looks like one snapshot didn't take, so I've pushed a commit with that.

@mistydemeo
Copy link
Contributor

Looking good! I'll just do some testing on my Windows machine later to make sure all works as I expect, but I think this should be good.

@jacobtread
Copy link
Contributor Author

Awesome thank you :)

@jacobtread
Copy link
Contributor Author

jacobtread commented Aug 24, 2025

Is there anything I can do to push this one forward for a new release? I'm hoping to use this in one of my projects some time soon :)

If not thats okay I can look into manually having it go up to npm separately

Edit: found the cargo-dist-url-override option :) so I'm all good no need to rush with this

@mistydemeo
Copy link
Contributor

Sorry for the delay! I’ve just been very busy lately, and hope to have time to integrate and release this soon.

@jacobtread
Copy link
Contributor Author

Sorry for the delay! I’ve just been very busy lately, and hope to have time to integrate and release this soon.

It's no worries!

I have modified the command to use args to prevent shell injection in the install dir / temp file name.

I've updated the snapshots that would run for me the "axolotlsay_basic" test is failing on my machine due to "failed to generate an OmniBOR Artifact ID (status: exit code: 2)" so If you could please run that on your machine for me if I've missed any snapshots 😄

@mistydemeo mistydemeo merged commit 12d585e into axodotdev:main Aug 27, 2025
17 checks passed
mistydemeo pushed a commit to mistydemeo/cargo-dist that referenced this pull request Aug 27, 2025
* fix: windows use powershell to extract zip file

For windows platforms the unzip utility is not on systems by default, this changes it so that on windows powershell is used in combination with Expand-Archive to extract the zip file

* chore: apply prettier formatting

* chore: update test snapshots

* chore: finish updating snapshots

* fix: prevent shell injection

* feat: update snapshots

* feat: use alternative param style for Extract-Archive

* tests: prettier and regen snapshots

* tests: regen snapshots
@jacobtread
Copy link
Contributor Author

Thank you!

mistydemeo added a commit that referenced this pull request Aug 27, 2025
* fix: windows use powershell to extract zip file

For windows platforms the unzip utility is not on systems by default, this changes it so that on windows powershell is used in combination with Expand-Archive to extract the zip file

* chore: apply prettier formatting

* chore: update test snapshots

* chore: finish updating snapshots

* fix: prevent shell injection

* feat: update snapshots

* feat: use alternative param style for Extract-Archive

* tests: prettier and regen snapshots

* tests: regen snapshots

Co-authored-by: Jacob <33708767+jacobtread@users.noreply.github.com>
@mistydemeo
Copy link
Contributor

I'll try to get a new release out soon.

@jacobtread
Copy link
Contributor Author

I'll try to get a new release out soon.

No rush from me :) I'm using a fork I published for the time being thank you for merging though!

@jacobtread
Copy link
Contributor Author

jacobtread commented Aug 27, 2025

@mistydemeo Hold off on deploying this to a release, I miss understood the .platform didn't realize that was an object, missed the line that pulled the object for it in from the package.json so the .includes is failing for zip installs I'll open a PR shortly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Npm install does not work on windows

3 participants

Comments