Skip to content

Commit

Permalink
Refactor workflow to streamline linking of compiled Groovy files
Browse files Browse the repository at this point in the history
  • Loading branch information
nattadasu committed Dec 12, 2024
1 parent bbf15f2 commit d6f50c3
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions .github/workflows/they_said_to_compile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,29 @@ jobs:
# Find groovy files starts with _ on current directory
groovyFiles=$(find . -type f -name "_*.groovy")
function link_file {
local file=$1
local loc=$2
local towindows=$(echo $loc | sed 's/posix/windows/')
if [ -e $loc ]; then
rm $loc
fi
if [ -e $towindows ]; then
rm $towindows
fi
ln -s $file $loc
ln -s $file $towindows
}
# Compile each groovy file
for file in $groovyFiles; do
compiledFile="compiled/$(basename "$file" | sed 's/^_//')"
fbname="$(basename "$file" | sed 's/^_//')"
compiledFile="compiled/$fbname"
psxloc="_posix_$fbname"
cpsxloc="compiled/posix_$fbname"
link_file "$file" "$psxloc"
python3 compiler.py "$file" "$compiledFile"
ln -s "$compiledFile" "compiled/posix_$compiledFile"
ln -s "$compiledFile" "compiled/windows_$compiledFile"
done
- name: Link old files
run: |
# link compiled/{}.groovy to compiled/posix_{}.groovy and compiled/windows_{}.groovy
for file in $(find compiled -type f -name "*.groovy"); do
fbname=$(basename "$file")
ln -s "$fbname" "compiled/posix_$fbname"
ln -s "$fbname" "compiled/windows_$fbname"
link_file "$compiledFile" "$cpsxloc"
done
- name: Run Groovy So-Called Compiler for post_ and preset_*.groovy files
run: |
Expand Down

0 comments on commit d6f50c3

Please sign in to comment.