#!/bin/bash

echo "# Debut des sources des crates "
echo 

for package in $*; do
        find $package -type f \(    -name '*.rs' -o -name '*.go' \
		                         -o -name '*.js' -o -name '*.ts' \
								 -o -name '*.vue' -o -name '*.css' \
								 -o -name '*.toml' \) -print \
|   grep -v 'webapp/[^s]' \
|	while  read -r file; do
		case "$file" in
		*.rs) language="rust" ;;
		*.go) language="go" ;;
		*.js) lanquage="javascript" ;;
		*.ts) language="typescript" ;;
		*.vue) language="vue" ;;
		*.css) language="css" ;;
		*.toml) language="toml" ;;
		*) language="" ;;
		esac
		
		echo "## fichier: \`$file\`"
		echo
		echo "\`\`\`$language"
		cat $file
		echo "\`\`\`"
		echo 
	done
done

