Skip to content
Merged
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
18 changes: 16 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,25 @@ build-backend = "pseudo_builder"

[tool.release-gitter]
git-url = "https://github.com/JohnnyMorganz/StyLua"
extract-files = ["stylua"]
extract-all = true
format = "stylua-{system}-{arch}.zip"
exec = "chmod +x stylua"
exec = """python -c "
import os
import stat
import platform

f = 'stylua'
s = platform.system()

if s in ('Linux', 'Darwin') and os.path.exists(f):
current_mode = os.stat(f).st_mode
os.chmod(f, current_mode | stat.S_IEXEC)
" """

Comment on lines +7 to +21
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need all this extraction change?

I'd imagine the only thing needed would be the new entry you've added to map-arch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change to extract-all = true is needed because Windows executables use the .exe extension while Unix-like systems do not, but this isn’t an issue since each .zip contains only one file. Is there a way to set the extract option dynamically by OS? Also, Windows lacks a default Bash shell, so using exec = "chmod +x stylua" without a Python wrapper will cause an error in Windows.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks for clarifying

[tool.release-gitter.map-arch]
arm64 = "aarch64"
AMD64 = "x86_64"

[tool.release-gitter.map-system]
Darwin = "macos"
Windows = "windows"
Expand Down
Loading