1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 22:57:46 +00:00

Add documentation to nu_deps (#369)

This commit is contained in:
Jakub Žádník 2023-01-31 23:40:56 +02:00 committed by GitHub
parent e6f3fe8e21
commit ec6acdd773
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 = []