mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-11 22:10:09 +01:00
feat: module periority
This commit is contained in:
parent
03904775f5
commit
c1e575c32a
9 changed files with 27 additions and 18 deletions
8
.github/workflows/build.yaml
vendored
8
.github/workflows/build.yaml
vendored
|
|
@ -88,8 +88,8 @@ jobs:
|
||||||
run: >
|
run: >
|
||||||
7z a pay-respects-${{ steps.version.outputs.VERSION }}-${{ matrix.target }}.zip
|
7z a pay-respects-${{ steps.version.outputs.VERSION }}-${{ matrix.target }}.zip
|
||||||
./target/${{ matrix.target }}/release/pay-respects.exe
|
./target/${{ matrix.target }}/release/pay-respects.exe
|
||||||
./target/${{ matrix.target }}/release/_pay-respects-module-runtime-rules.exe
|
./target/${{ matrix.target }}/release/_pay-respects-module-100-runtime-rules.exe
|
||||||
./target/${{ matrix.target }}/release/_pay-respects-fallback-request-ai.exe
|
./target/${{ matrix.target }}/release/_pay-respects-fallback-100-request-ai.exe
|
||||||
|
|
||||||
- name: zipping files (unix)
|
- name: zipping files (unix)
|
||||||
if: runner.os != 'Windows'
|
if: runner.os != 'Windows'
|
||||||
|
|
@ -97,8 +97,8 @@ jobs:
|
||||||
tar -czf pay-respects-${{ steps.version.outputs.VERSION }}-${{ matrix.target }}.tar.gz
|
tar -czf pay-respects-${{ steps.version.outputs.VERSION }}-${{ matrix.target }}.tar.gz
|
||||||
-C target/${{ matrix.target }}/release
|
-C target/${{ matrix.target }}/release
|
||||||
pay-respects
|
pay-respects
|
||||||
_pay-respects-module-runtime-rules
|
_pay-respects-module-100-runtime-rules
|
||||||
_pay-respects-fallback-request-ai
|
_pay-respects-fallback-100-request-ai
|
||||||
|
|
||||||
- name: uploading to release
|
- name: uploading to release
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,11 @@ All notable changes to components of this project since 0.5.14 will be documente
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## [Unreleased]
|
## [0.6.1] - 2024-12-09
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Custom priority for modules
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
|
@ -45,7 +49,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
History start.
|
History start.
|
||||||
|
|
||||||
[unreleased]: https://github.com/iffse/pay-respects/compare/v0.6.0..HEAD
|
[unreleased]: https://github.com/iffse/pay-respects/compare/v0.6.1..HEAD
|
||||||
|
[0.6.1]: https://github.com/iffse/pay-respects/compare/v0.6.0..v0.6.1
|
||||||
[0.6.0]: https://github.com/iffse/pay-respects/compare/v0.5.15..v0.6.0
|
[0.6.0]: https://github.com/iffse/pay-respects/compare/v0.5.15..v0.6.0
|
||||||
[0.5.15]: https://github.com/iffse/pay-respects/compare/v0.5.14..v0.5.15
|
[0.5.15]: https://github.com/iffse/pay-respects/compare/v0.5.14..v0.5.15
|
||||||
[0.5.14]: https://github.com/iffse/pay-respects/commits/v0.5.14
|
[0.5.14]: https://github.com/iffse/pay-respects/commits/v0.5.14
|
||||||
|
|
|
||||||
4
Cargo.lock
generated
4
Cargo.lock
generated
|
|
@ -481,7 +481,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pay-respects-module-request-ai"
|
name = "pay-respects-module-request-ai"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"colored",
|
"colored",
|
||||||
"curl",
|
"curl",
|
||||||
|
|
@ -494,7 +494,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pay-respects-module-runtime-rules"
|
name = "pay-respects-module-runtime-rules"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"pay-respects-utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"pay-respects-utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"regex-lite",
|
"regex-lite",
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,6 @@ pay-respects-utils = "0.1.0"
|
||||||
[package.metadata.deb]
|
[package.metadata.deb]
|
||||||
assets = [
|
assets = [
|
||||||
["target/release/pay-respects", "usr/bin/", "755"],
|
["target/release/pay-respects", "usr/bin/", "755"],
|
||||||
["target/release/_pay-respects-module-runtime-rules", "usr/bin/", "755"],
|
["target/release/_pay-respects-module-100-runtime-rules", "usr/bin/", "755"],
|
||||||
["target/release/_pay-respects-fallback-request-ai", "usr/bin/", "755"],
|
["target/release/_pay-respects-fallback-100-request-ai", "usr/bin/", "755"],
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,8 @@ impl Data {
|
||||||
executables.push(exe.to_string());
|
executables.push(exe.to_string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
modules.sort_unstable();
|
||||||
|
fallbacks.sort_unstable();
|
||||||
if alias.is_some() {
|
if alias.is_some() {
|
||||||
let alias = alias.as_ref().unwrap();
|
let alias = alias.as_ref().unwrap();
|
||||||
for command in alias.keys() {
|
for command in alias.keys() {
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ main() {
|
||||||
echo "Detected architecture: ${_arch}"
|
echo "Detected architecture: ${_arch}"
|
||||||
|
|
||||||
local _bin_name="pay-respects"
|
local _bin_name="pay-respects"
|
||||||
local _modules="_pay-respects-module-runtime-rules _pay-respects-fallback-request-ai"
|
local _modules="_pay-respects-module-100-runtime-rules _pay-respects-fallback-100-request-ai"
|
||||||
case "${_arch}" in
|
case "${_arch}" in
|
||||||
*windows*)
|
*windows*)
|
||||||
_bin_name="${_bin_name}.exe"
|
_bin_name="${_bin_name}.exe"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "pay-respects-module-request-ai"
|
name = "pay-respects-module-request-ai"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
description = "AI request module for the pay-respects CLI tool"
|
description = "AI request module for the pay-respects CLI tool"
|
||||||
|
|
@ -27,5 +27,5 @@ default = ["libcurl"]
|
||||||
libcurl = ["dep:curl"]
|
libcurl = ["dep:curl"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "_pay-respects-fallback-request-ai"
|
name = "_pay-respects-fallback-100-request-ai"
|
||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "pay-respects-module-runtime-rules"
|
name = "pay-respects-module-runtime-rules"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# for crates.io
|
# for crates.io
|
||||||
|
|
@ -20,5 +20,5 @@ pay-respects-utils = "0.1.0"
|
||||||
# pay-respects-utils = { path = "../utils" }
|
# pay-respects-utils = { path = "../utils" }
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "_pay-respects-module-runtime-rules"
|
name = "_pay-respects-module-100-runtime-rules"
|
||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,12 @@
|
||||||
There are 2 types of modules:
|
There are 2 types of modules:
|
||||||
|
|
||||||
- **Standard module**: Will always run to retrieve suggestions
|
- **Standard module**: Will always run to retrieve suggestions
|
||||||
- Naming convention: `_pay-respects-module-<your module name>`
|
- Naming convention: `_pay-respects-module-<priority>-<your module name>`
|
||||||
- **Fallback module**: Will only be run if no previous suggestion were found
|
- **Fallback module**: Will only be run if no previous suggestion were found
|
||||||
- **CAUTION**: Will immediately return if a suggestion is obtained, and there is no guaranteed the modules are executed in a specific order.
|
- **CAUTION**: Will immediately return if a suggestion is obtained
|
||||||
- Naming convention: `_pay-respects-fallback-<your module name>`
|
- Naming convention: `_pay-respects-fallback-<priority>-<your module name>`
|
||||||
|
|
||||||
|
Priority is used to retrieve suggestions in a specific order by an [unstable sort](https://doc.rust-lang.org/std/primitive.slice.html#method.sort_unstable) (although they will always be after compile-time matches). Default modules have a priority of `100`.
|
||||||
|
|
||||||
When running your module, you will get the following environment variables:
|
When running your module, you will get the following environment variables:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue