INNER CODE UNIT · Julia
base
astroautomata/SymbolicRegression.jl · src/scripts/fromfile_to_modules.sh:9
base=$(basename ${file%.*})
cat $file | vims -t '%g/^@from/s/@from "\(.\{-}\)\.jl" import/import ..\1Module:/g' -e 'using FromFile' 'dd' -s "Omodule ${base}Module\<enter>" 'Go\<enter>end' | sed "s/^ $//g" > tmp.jl
mv tmp.jl $file
done
# Changes to make:
# - Run this file on everything.
# - Change `import ..` to `import .` in SymbolicRegression.jl
# - Rename module that have same name as existing variables:
# - All files are mapped to _{file}.jl, and modules as well.