24 lines
461 B
Bash
24 lines
461 B
Bash
#!/bin/bash
|
|
|
|
develop_lua_dir=$1
|
|
src_dir_length=$2
|
|
src_dir_length_2=$(expr $src_dir_length + 1)
|
|
dst_dir=$3
|
|
luac=$4
|
|
|
|
function read_dir(){
|
|
for file in `ls $1`
|
|
do
|
|
if [ -d $1"/"$file ]
|
|
then
|
|
read_dir $1"/"$file
|
|
else
|
|
file_path=$1"/"$file
|
|
if [ "${file##*.}"x = "lua"x ]; then
|
|
$luac -o ${dst_dir}${file_path:$src_dir_length}.bytes ${file_path:$src_dir_length_2}
|
|
fi
|
|
fi
|
|
done
|
|
}
|
|
|
|
read_dir $develop_lua_dir |