mirror of
https://github.com/nushell/awesome-nu.git
synced 2024-09-11 13:37:48 +03:00
Merge pull request #41 from FMotalleb/main
Fix: Handle .git extensions in repository URLs
This commit is contained in:
commit
344529e8dd
@ -133,7 +133,7 @@ export module plugin-list {
|
||||
def "get-toml" [
|
||||
branch: string # branch name (e.g. main)
|
||||
]: string -> record {
|
||||
let git_repo = $in # github repository url (e.g. https://github.com/FMotalleb/nu_plugin_port_scan)
|
||||
let git_repo = ($in | str replace --regex ".git$" "") # 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)
|
||||
try {
|
||||
return (http get --raw $toml_file_address | from toml)
|
||||
@ -151,8 +151,11 @@ export module plugin-list {
|
||||
# TODO handle error
|
||||
def "get self or version" []: record -> string , string -> string {
|
||||
let input = $in
|
||||
|
||||
if ($input | is-str) {
|
||||
return $input;
|
||||
} else if ($input.version? | is-empty) {
|
||||
return "0.0.0"
|
||||
} else {
|
||||
return $input.version
|
||||
}
|
||||
@ -164,7 +167,7 @@ export module plugin-list {
|
||||
repository: string
|
||||
]: record -> record {
|
||||
let toml: record = $in
|
||||
if ([$toml.package?, $toml.dependencies?] | all {|i| $i != null} ) {
|
||||
if ([$toml.package?, $toml.dependencies?] | all {|i| $i != null}) {
|
||||
return {
|
||||
name: $"[($toml.package.name)]\(($repository)\)"
|
||||
version: $toml.package.version
|
||||
|
@ -232,14 +232,13 @@ plugins:
|
||||
- name: nu_plugin_dpkgtable
|
||||
language: rust
|
||||
repository:
|
||||
url: https://github.com/pdenapo/nu_plugin_dpkgtable.git
|
||||
branch: main
|
||||
url: https://github.com/pdenapo/nu_plugin_dpkgtable
|
||||
branch: main
|
||||
- name: nu_plugin_from_sse
|
||||
language: rust
|
||||
repository:
|
||||
url: https://github.com/cablehead/nu_plugin_from_sse
|
||||
branch: main
|
||||
|
||||
# Example
|
||||
# - name: nu_plugin_bin_reader # the plugins name (mandatory)
|
||||
# language: python # programming language (mandatory)
|
||||
|
Loading…
Reference in New Issue
Block a user