Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Jan9103/merge_nu_scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Merge Nu Scripts

does exactly what the name says.

since both nu -c ast and nu --ide-ast do not retain all important information this is for now regex-based and therefore limited.

Limitations:

  • use and export use have to be the first command in a line or stand directly after a ;.
    • if either condition is met within a (multiline-) string it will get screwed up.
  • $NU_LIB_DIRS are not supported. use relative imports instead.
  • source is not supported.
  • The conversion-script should be able to run on windows, but it has never been tested.

Usage:

python3 merge_nu_files.py main_file.nu

How does it work?

A few steps to understand why it does what:

  1. use works the same on both files and in-file defined modules
  2. thus use file.nu is equal to module file { FILE_CONTENTS }
  3. PROBLEM: / can't be included in the name of a in-file module and duplicate names can exist with files.
  4. SOLUTION: randomize the name
  5. PROBLEM: the names of the modules changed and thus also commands
  6. SOLUTION: use abc file and use file both result in file <command>

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Languages