From 39e94b58e473982c07c75c541d251381ed8bbe3c Mon Sep 17 00:00:00 2001 From: amtoine Date: Sun, 26 May 2024 16:23:39 +0200 Subject: [PATCH 1/3] add `deps.nu` to install Nushell deps --- scripts/deps.nu | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 scripts/deps.nu diff --git a/scripts/deps.nu b/scripts/deps.nu new file mode 100644 index 0000000..fd43f4d --- /dev/null +++ b/scripts/deps.nu @@ -0,0 +1,36 @@ +const NUSHELL_REMOTE = "https://github.com/nushell/nushell" +const PKGS = [ "nuon", "nu-protocol", "nu-plugin" ] + +# setup Nushell dependencies +# +# > **Note** +# > options are shown in inverse order of precedence +export def main [ + --rev: string, # a Nushell revision + --tag: string, # a Nushell tag + --current, # use the current Nushell version +] { + let opts = if $current { + if (version).commit_hash != null { + print $"using current revision of Nushell: (version | get commit_hash)" + [ --rev (version).commit_hash ] + } else { + print $"using current version of Nushell: (version | get version)" + [ --tag (version).version ] + } + } else { + if $tag != null { + print $"using user version: ($tag)" + [ --tag $tag ] + } else if $rev != null { + print $"using user revision: ($rev)" + [ --rev $rev ] + } else { + error make --unspanned { msg: "please give either `--rev` or `--tag`" } + } + } + + for pkg in $PKGS { + cargo add $pkg --git $NUSHELL_REMOTE ...$opts + } +} From 19e47aecac334280d57700fe7cec67342cda9e40 Mon Sep 17 00:00:00 2001 From: amtoine Date: Sun, 26 May 2024 16:27:32 +0200 Subject: [PATCH 2/3] add a new section to the README --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 04ed8a2..6af48e9 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ A fast *interactive explorer* tool for *structured data* inspired by [`nu-explor - [*an example*](#an-example) - [*some convenience*](#-some-convenience) - [*see the documentation locally*](#see-the-documentation-locally) +- [*troubleshooting*](#troubleshooting) - [*contributing*](#contributing) - [*TODO*](#todo) - [*features*](#features) @@ -110,6 +111,20 @@ and voila :yum: cargo doc --document-private-items --no-deps --open ``` +# troubleshooting +in case you get some weird error or behaviour, before filing any issue, the +easiest is to make sure the plugin is compiled with the same revision as the +Nushell you are using! +```nushell +use scripts/deps.nu; deps --current +``` +and then you can come back to the [*installation*](#installation) section. + +> **Note** +> of course, this will not work if the version of Nushell you are using is too +> old, because then the state of `nu_plugin_explore` will be too recent for +> everything to compile properly... + # contributing in order to help, you can have a look at - the [todo](#todo) list down below, there might be unticked tasks to tackle From 8158cd74ec2b775bfd9584f3af2c2bbd63b12c25 Mon Sep 17 00:00:00 2001 From: amtoine Date: Sun, 26 May 2024 16:29:39 +0200 Subject: [PATCH 3/3] add a note in "installation" section --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 6af48e9..d32d055 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,13 @@ will come very handy in a day-to-day basis for me at least :) so here we are... LET'S GO :muscle: # installation +> **Important** +> if you are using bleeding-edge versions of Nushell, please make sure the +> Nushell dependencies are the same as your Nushell install by running +> ```nushell +> use scripts/deps.nu; deps --current +> ``` + ## using `nupm install` (recommended) - download [nushell/nupm](https://github.com/nushell/nupm) - load the `nupm` module