hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

modules (372B)


      1 #!/bin/sh
      2 set -e
      3 
      4 lookup() {
      5 	for i in "$1"/*
      6 	do
      7 		i="${i#./}"
      8 		[ -d "$i" ] || continue
      9 		case "$i" in
     10 			.*|*+*|cmd|contrib|docs|scripts)
     11 				continue
     12 				;;
     13 			*)
     14 				for j in "$i"/*.ha
     15 				do
     16 					[ -e "$j" ] || break
     17 					i="$(printf '%s\n' "${i%/}" | sed 's|/|::|g')"
     18 					printf 'use %s;\n' "$i"
     19 					break
     20 				done
     21 				lookup "$i"
     22 				;;
     23 		esac
     24 	done
     25 }
     26 
     27 lookup .