<commit_before><commit_msg>whipe: tiny tool to recursively remove dir<commit_after>package main

import (
	"flag"
	"fmt"
	"os"
	"path/filepath"
)

var fake = flag.Bool("fake", false, "only print what it is about to do")

func rmSymlink(path string, info os.FileInfo, err error) error {
	if info.Mode()&os.ModeSymlink != 0 {
		dereferenced, err := os.Readlink(path)
		if err != nil {
			return err
		}
		if *fake {
			fmt.Printf("removing '%s'\n", dereferenced)
		} else {
			err = os.Remove(dereferenced)
			return err
		}

	}
	return nil
}

func main() {
	flag.Parse()
	root := flag.Args()[0]

	filepath.Walk(root, rmSymlink)
	if *fake {
		fmt.Printf("removing '%s'\n", root)
	} else {
		os.RemoveAll(root)

	}
}
{'fraction_non_alphanumeric': 0.15287517531556802, 'fraction_numerical': 0.002805049088359046, 'mean_word_length': 3.5477707006369426, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1408970', 'n_tokens_mistral': 298, 'n_tokens_neox': 274, 'n_words': 70}