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
Changes from 1 commit
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
Next Next commit
fix (wont crash if branch is incorrect
  • Loading branch information
FMotalleb committed Dec 6, 2023
commit ab5ff5515520e6c40cf4b30a129b6d3d5a5f016d
33 changes: 24 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 Down