Skip to content

Commit

Permalink
Merge pull request #41 from FMotalleb/main
Browse files Browse the repository at this point in the history
Fix: Handle .git extensions in repository URLs
  • Loading branch information
fdncred committed Apr 20, 2024
2 parents 65af689 + 302a065 commit 344529e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 5 additions & 2 deletions action.nu
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
}
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 344529e

Please sign in to comment.