mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-03 11:17:05 -04:00
Add a run.sh
file that automatically downloads or updates zig and runs the game.
This is a step towards #103
This commit is contained in:
parent
6c896e2e93
commit
54337f17fd
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
compiler/
|
||||
logs/
|
||||
saves/
|
||||
zig-out/
|
||||
@ -6,4 +7,4 @@ serverAssets/
|
||||
settings.json
|
||||
gui_layout.json
|
||||
|
||||
test.png
|
||||
test.png
|
||||
|
@ -39,6 +39,7 @@ I also had to install a few `-dev` packages for the compilation to work:
|
||||
```
|
||||
sudo apt install libgl-dev libasound2-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxext-dev libxi-dev
|
||||
```
|
||||
For Linux there is also a handy `run.sh` file that automatically downloads the correct zig version
|
||||
|
||||
# Contributing
|
||||
### Code
|
||||
|
20
run.sh
Executable file
20
run.sh
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
version=zig-linux-x86_64-0.12.0-dev.596+2adb932ad
|
||||
|
||||
mkdir -p compiler/zig
|
||||
touch compiler/version.txt
|
||||
if [[ $(< compiler/version.txt) != "$version" ]]; then
|
||||
echo "Deleting old zig installation..."
|
||||
rm -r compiler/zig
|
||||
mkdir compiler/zig
|
||||
echo "Downloading zig version $version..."
|
||||
wget -O compiler/archive.tar.xz https://ziglang.org/builds/$version.tar.xz
|
||||
echo "Extracting tar file..."
|
||||
tar --xz -xf compiler/archive.tar.xz --directory compiler/zig --strip-components 1
|
||||
echo "Done."
|
||||
rm compiler/version.txt
|
||||
printf "$version" >> compiler/version.txt
|
||||
fi
|
||||
|
||||
./compiler/zig/zig build run $@
|
Loading…
x
Reference in New Issue
Block a user