dotfiles/scripts/dummy
Geoffrey Frogeye ee178b7d57
nix: Make nix the root
Which means now I'll have to think about real prefixes in commit names.
2023-11-26 23:58:22 +01:00

17 lines
382 B
Plaintext
Executable file

#!/usr/bin/env nix-shell
#! nix-shell -i bash --pure
#! nix-shell -p bash tree coreutils
# Remplace le contenu d'un dossier par un fichier texte
# relatant son arborescense
dir="$(echo "$1" | sed 's|/\+||')"
if [ -d "$dir" ]; then
TEMP=$(mktemp)
tree -a -p -D -n "$dir" > "$TEMP"
mv "$dir" "$dir.bkp"
mv "$TEMP" "$dir"
else
echo "$dir n'est pas un dossier"
fi