Geoffrey Frogeye
1f61ceb395
They're a bit slower to start :(. Hopefully this is something that flakes will help with, otherwise I'll find another way.
17 lines
382 B
Plaintext
Executable file
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
|