From 86b54db197fce30b1250e786b0d7f65e11d198f9 Mon Sep 17 00:00:00 2001 From: trivernis Date: Fri, 28 Oct 2022 22:55:21 +0200 Subject: [PATCH] Add utility script to run cargo clean in a dir --- .../share/scripts/executable_cargo-clean-all.nu | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 dot_local/share/scripts/executable_cargo-clean-all.nu diff --git a/dot_local/share/scripts/executable_cargo-clean-all.nu b/dot_local/share/scripts/executable_cargo-clean-all.nu new file mode 100644 index 0000000..bc65084 --- /dev/null +++ b/dot_local/share/scripts/executable_cargo-clean-all.nu @@ -0,0 +1,15 @@ +#!/bin/nu + +def main [ + dir: string # The directory that contains the rust projects +] { + echo $"Cleaning ($dir)" + ( + ls $dir + | get name + | where ($it | ls $it | where name =~ 'Cargo.toml' | length ) > 0 + | par-each { cd $in; cargo clean } + | ignore + ) + echo $"($dir) cleaned" +}