github.com/ladydascalie/elvish@v0.0.0-20170703214355-2964dd3ece7f/eval/gen-embedded-modules (about)

     1  #!/usr/bin/env elvish
     2  
     3  out = ./embedded_modules.go
     4  
     5  {
     6  	echo "package eval"
     7  	echo "var embeddedModules = map[string]string{"
     8  
     9  	for f [*.elv] {
    10  		print '"'$f[:-4]'": `'
    11  		cat $f | sed 's/`/`+"`"+`/g'
    12  		echo '`,'
    13      }
    14  
    15  	echo "}"
    16  } > $out
    17  
    18  gofmt -w $out