Hi there! I'm new here and this is a real nice application!
I'm making a couple of integrated scripts which have lot of common code between them. As currently we don't have statements like "include", is necessary to paste the common code on every file. This is really hard to maintain...
I solved this by creating a batch that merges a file containing the common code and the script specific code, works like this:
1) I created a "dev" folder on the root of SexScripts
2) Moved all my scripts to it, I'm using Notepad++ to edit.
3) Created a script file with all common code, and cleaned it on other files
4) The batch merges the common code with other scripts into new files inside of the "scripts" directory;
Bellow is an example of how this batch works. The files "myscript", "teasings" and "tests" are the scripts and the "commcode" is the code that should be shared with every file.
Code:
@echo off
rd /s /q ..\scripts\myscript
md ..\scripts\myscript
type commcode.groov myscript.groovy > ..\scripts\myscript.groovy
type commcode.groov teasings.groovy > ..\scripts\myscript\teasings.groovy
type commcode.groov tests.groovy > ..\scripts\myscript\tests.groovy
..\sexscripts myscript
I didn't test on Linux, but this might work:
Code:
#!/bin/sh
rm -rf ../scripts/myscript/*
cat commcode.groov myscript.groovy > ../scripts/myscript.groovy
cat commcode.groov teasings.groovy > ../scripts/myscript/teasings.groovy
cat commcode.groov tests.groovy > ../scripts/myscript/tests.groovy
../sexscripts.sh myscript