From ec6acdd773cb52c77eeb84e524ead3db02cd182c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=BD=C3=A1dn=C3=ADk?= Date: Tue, 31 Jan 2023 23:40:56 +0200 Subject: [PATCH] Add documentation to nu_deps (#369) --- make_release/nu_deps.nu | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/make_release/nu_deps.nu b/make_release/nu_deps.nu index 871ba86..88769d0 100644 --- a/make_release/nu_deps.nu +++ b/make_release/nu_deps.nu @@ -1,5 +1,9 @@ -#!/usr/env/bin nu +# Go through Nushell dependencies in the first wave and find the right ordering +# +# Recommended usage is via a module which allows you to process the output +# further. +# Extract target-specific dependencies from an opened Cargo.toml def get-target-dependencies [] { let target = ($in | get -i target) @@ -19,8 +23,9 @@ def get-target-dependencies [] { $res } -# Gather dependencies for each Nushell crate -def nu-deps [] { +# For each Nushell crate in the first publishing wave, open its Cargo.toml and +# gather its dependencies. +def find-deps [] { let second_wave = [ 'nu-command' ] let third_wave = [ 'nu-cli' ] @@ -45,8 +50,12 @@ def nu-deps [] { } } +# Find the right publish ordering of Nushell crates based on their dependencies +# +# Returns a list which you can process further, e.g.: +# > nu_deps | str join (',' + (char nl)) export def main [] { - let deps = nu-deps + let deps = find-deps mut list = []