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

Fix: Handle .git extensions in repository URLs #41

Merged
merged 3 commits into from
Apr 20, 2024
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
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