Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for skript resources via SPIGET_RESOURCES #2764

Merged
merged 2 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions examples/skript/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
mc:
image: itzg/minecraft-server
environment:
EULA: true
TYPE: PAPER
PLUGINS: https://github.com/SkriptLang/Skript/releases/download/2.8.4/Skript.jar
SPIGET_RESOURCES: 103749
ports:
- "25565:25565"
21 changes: 13 additions & 8 deletions scripts/start-spiget
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,20 @@ downloadResourceFromSpiget() {
log "ERROR: failed to retrieve file type of resource $resource"
exit 1
fi
if containsPlugin "${outfile}"; then
log "Moving resource ${resource} into plugins"
mv "$outfile" /data/plugins
elif containsJars "${outfile}"; then
log "Extracting contents of resource ${resource} into plugins"
extract "$outfile" /data/plugins
if [[ $fileType = .sk ]]; then
mkdir -p /data/plugins/Skript/scripts
mv "$outfile" /data/plugins/Skript/scripts
else
log "ERROR: file for resource ${resource} has an unexpected file type: ${fileType}"
exit 2
if containsPlugin "${outfile}"; then
log "Moving resource ${resource} into plugins"
mv "$outfile" /data/plugins
elif containsJars "${outfile}"; then
log "Extracting contents of resource ${resource} into plugins"
extract "$outfile" /data/plugins
else
log "ERROR: file for resource ${resource} has an unexpected file type: ${fileType}"
exit 2
fi
fi
rm -rf "$tempDir"
}
Expand Down