diff --git a/README.md b/README.md index 6299945..5a9a562 100644 --- a/README.md +++ b/README.md @@ -68,3 +68,9 @@ Full usage is as follows: A list of file name to extract from downloaded archive --extract-all, -x Shell commands to execute after download or extraction --url-only Only print the URL and do not download + +### Pre-Commit usage + +This can be used a way to wrap a binary release from a Github or Gitea by adding a `pyproject.toml` file to your current project directory and adding a `.pre-commit-hooks.yaml` file. + +Take a look at the `./sample_pseudo_bin` directory to see an example. diff --git a/pseudo_builder.py b/pseudo_builder.py index 3488e78..91391e4 100644 --- a/pseudo_builder.py +++ b/pseudo_builder.py @@ -1,6 +1,6 @@ """ This builder functions as a pseudo builder that instead downloads and installs a binary file using -release-gitter based on a pyproject.toml file +release-gitter based on a pyproject.toml file. It's a total hack... """ from pathlib import Path from shutil import copytree diff --git a/sample_pseudo_bin/.pre-commit-hooks.yaml b/sample_pseudo_bin/.pre-commit-hooks.yaml new file mode 100644 index 0000000..4fd1e72 --- /dev/null +++ b/sample_pseudo_bin/.pre-commit-hooks.yaml @@ -0,0 +1,8 @@ +--- +- id: stylua + name: StyLua + description: An opinionated Lua code formatter + entry: stylua + language: python + types: + - lua diff --git a/sample_pseudo_bin/pyproject.toml b/sample_pseudo_bin/pyproject.toml new file mode 100644 index 0000000..cdc43ec --- /dev/null +++ b/sample_pseudo_bin/pyproject.toml @@ -0,0 +1,17 @@ +[build-system] +requires = ["release-gitter[builder]"] +build-backend = "pseudo_builder" + +[tool.release-gitter] +# git-url is not needed if you're in the actual source repo +git-url = "https://github.com/JohnnyMorganz/StyLua" +# version is not needed if you have a Cargo.toml in the current directory +version = "0.11.3" + +extract-files = [ "stylua" ] +format = "stylua-{version}-{system}.zip" +exec = "chmod +x stylua" +[tool.release-gitter.map-system] + Darwin = "macos" + Windows = "win64" + Linux = "linux"