Skip to content

Commit

Permalink
add sh
Browse files Browse the repository at this point in the history
  • Loading branch information
InvalidArgument3 committed Jun 3, 2024
1 parent 5c6bf05 commit 1d0a8ca
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions ModIdFinder.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

# Part of the UniversalUpload workflow, by Aristeas.
# Don't touch this unless stuff breaks, everything's automatic.

IFS=','; arrIN=($1); unset IFS;
find . -type f -name "*.sbmi" >> ./allModDatas.txt

MODIDARR=()

while read path; do
while read sbmiLine; do
if [[ $sbmiLine = \<Id\>* ]] ; then
tmp=${sbmiLine#*>}
modId=${tmp%<*}
modPathTmp=${path%/*}
modPath=${modPathTmp// /\`}

for editedFile in "${arrIN[@]}"
do
if [[ "./$editedFile" == "$modPathTmp"* ]] ; then
MODIDARR+=(\{\"value\":$modId,\"path\":\"$modPath\"\})
break
fi
done
fi
done < "$path"
done < allModDatas.txt

delim=""
joined=""
for item in "${MODIDARR[@]}"; do
joined="${joined}${delim}${item//\`/ }"
delim=","
done
echo "matrix={\"include\":[$joined]}]"

echo > allModDatas.txt
Empty file.

0 comments on commit 1d0a8ca

Please sign in to comment.