Created
December 12, 2021 14:43
-
-
Save ZwerOxotnik/f7e88bb226f1e36ec5d52367ee197b0f to your computer and use it in GitHub Desktop.
lua2p (bash script + vscode task)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### Compile *.lua2p files to *.lua files and format them | |
### https://github.com/ReFreezed/LuaPreprocess | |
use_cmd=0 | |
case "$OSTYPE" in | |
win32|cygwin|msys) use_cmd=1 ;; | |
esac | |
parameters=$1 | |
format=*.lua2p | |
files=($(find . -name "$format" -type f)) | |
for path in "${files[@]}"; | |
do | |
if [[ "$path" == "$format" ]] | |
then | |
echo "No Files" | |
else | |
if [ $use_cmd -eq 1 ]; then | |
Preprocess.cmd $parameters $path | |
else | |
lua preprocess-cl.lua $parameters $path | |
fi | |
fi | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "lua2p to Lua [debug]", | |
"type": "shell", | |
"problemMatcher": [], | |
"command": "bash", | |
"args": [".scripts/lua2p.sh.sh", "--debug"], | |
"group": "build" | |
}, | |
{ | |
"label": "lua2p to Lua [release]", | |
"type": "shell", | |
"problemMatcher": [], | |
"command": "bash", | |
"args": [".scripts/lua2p.sh.sh", "--release"], | |
"group": "build" | |
}, | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment