A file modulator for big files, separating them, enabling the organization of the code without a headache with copies and pastes!
- join multiple files / importing files.
- ignore commented imports.
- Download the lasted compiled version and .env.example.
- Move it to your project's root folder;
- Exec
cp .env.example .env
or manually rename .env.example file to.env
; - Replace the corresponding variables in your
.env
file;
WATCH_FOLDER
= Folder where you keep your scripts.INPUT_FILE
= Name with the extension of the input file, which will be located in the scripts folder of the variableWATCH_FOLDER
.OUTPUT_FILE
= Output path with name of the file where the project transpilation will be exported.
Root:
Subfolders:
Contents:
.env
#Default configs
WATCH_FOLDER = "./source/" # Example main folder to sources
INPUT_FILE = "main.cs" # Main file name with extension, it should be in your watch folder.
OUTPUT_FILE = "./output/transpiled.cs" # Your output file path with extension
AFTER_IMPORT = "\n" # String which will be loaded after finding a file to import
# Change if you have an idea of what you are doing
IMPORTER_REGEX = "importar\((.*?)\)|import\((.*?)\)" # Regex of importer
TABS_REGEX = "^(?:( )+|\t+)" # Regex of tabs
COMMENT_REGEX = "(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(\/\/.*)|(#.*)" #regex of comments
source/main.cs
import("file.cs");
import("subfolder/file_subfolder.cs");
source/file1.cs
//Hi, i'm file1.cs
source/subfolder/file_subfolder.cs
//Hi, i'm file_subfolder.cs
After run the sBotics File modulator which is in the root folder, the contents of the output/transpiled.cs
file is updated to:
//Hi, i'm file1
//Hi, i'm file_subfolder
- After save any file inside the
WATCH_FOLDER
path, the output is automatically updated! - For import files you can use
import
orimportar
prefix function. - The example can be found in this repository
- Realeases are for 64-bit architectures only, but you can build your own executable :)