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

fixed detailed plugin report #32

Merged
merged 7 commits into from
Dec 6, 2023
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/update-results.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ on:
# push:
# branches:
# - main
workflow_dispatch:
schedule:
- cron: '0 3 * * 3' # At 03:00 on Wednesday

Expand Down
36 changes: 27 additions & 9 deletions action.nu
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ export module plugin-list {
]: string -> record {
let git_repo = $in # github repository url (e.g. https://github.com/FMotalleb/nu_plugin_port_scan)
let toml_file_address: string = (get-raw-toml-address $git_repo $branch | url join)
return (http get --raw $toml_file_address | from toml)
try {
return (http get --raw $toml_file_address | from toml)
} catch {
return {}
}
}

# checks if given input is string or not
Expand All @@ -160,15 +164,26 @@ export module plugin-list {
repository: string
]: record -> record {
let toml: record = $in
return {
name: $"[($toml.package.name)]\(($repository)\)"
version: $toml.package.version
description: $toml.package.description?
plugin: ($toml.dependencies.nu-plugin
| get self or version)
protocol: ($toml.dependencies.nu-protocol
| get self or version)
if ([$toml.package?, $toml.dependencies?] | all {|i| $i != null} ) {
return {
name: $"[($toml.package.name)]\(($repository)\)"
version: $toml.package.version
description: $toml.package.description?
plugin: ($toml.dependencies.nu-plugin
| get self or version)
protocol: ($toml.dependencies.nu-protocol
| get self or version)
}
} else {
return {
name: $"issue in config file for \(($repository)\)"
version: "0.0"
description: ""
plugin: "0.0"
protocol: "0.0"
}
}

}

def "get icon" []: int -> string {
Expand All @@ -194,6 +209,9 @@ export module plugin-list {
]: record -> record {
let input = $in
use version "compare to"
if ($input | is-empty) {
return $input
}
if ((($input.plugin | compare to $min_plugin) == -1) or ($input.protocol | compare to $min_protocol) == -1) {
return ($input
| upsert plugin $"⛔($input.plugin)"
Expand Down
9 changes: 7 additions & 2 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,13 @@ plugins:
language: bash
repository:
url: https://github.com/tesujimath/nu_plugin_bash_env
branch: main

branch: master
override: # override any field in the result record (do not use unless you have to `like the plugin is written in Python`)
name: "[nu_plugin_bash_env](https://github.com/tesujimath/nu_plugin_bash_env)"
version: "0.0.0"
description: "A Bash environment plugin for Nushell."
plugin: "0.87"
protocol: "0.87"
# Example
# - name: nu_plugin_bin_reader # the plugins name (mandatory)
# language: python # programming language (mandatory)
Expand Down
7 changes: 3 additions & 4 deletions plugin_details.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[table 35 rows]
EvalBlockWithInput(Span { start: 107689, end: 107693 }, [NetworkFailure("Requested file not found (404): \"https://raw.githubusercontent.com/hulthe/nu_plugin_msgpack/main/Cargo.toml\"", Span { start: 112246, end: 112264 })])
EvalBlockWithInput(Span { start: 107689, end: 107693 }, [CantFindColumn { col_name: "plugin", span: Span { start: 114193, end: 114199 }, src_span: Span { start: 114186, end: 114192 } }])
[table 36 rows]
EvalBlockWithInput(Span { start: 107690, end: 107694 }, [CantFindColumn { col_name: "plugin", span: Span { start: 114641, end: 114647 }, src_span: Span { start: 114634, end: 114640 } }])

last update at `2023-12-06 03:09:55 +00:00`
last update at `2023-12-06 07:11:16 +00:00`