Automatically fetch hash in project setup

This commit is contained in:
Not-Nik 2024-05-15 22:36:08 +02:00
parent 28f9a051e4
commit 3a18a355e3
No known key found for this signature in database
GPG Key ID: E95F679E3CDD9784

View File

@ -55,8 +55,9 @@ pub fn build(b: *std.Build) !void {
run_step.dependOn(&run_cmd.step); run_step.dependOn(&run_cmd.step);
b.installArtifact(exe); b.installArtifact(exe);
} }' >> build.zig
' >> build.zig
HASH=$(zig fetch https://github.com/Not-Nik/raylib-zig/archive/devel.tar.gz)
echo '.{ echo '.{
.name = "'$PROJECT_NAME'", .name = "'$PROJECT_NAME'",
@ -64,14 +65,11 @@ echo '.{
.dependencies = .{ .dependencies = .{
.@"raylib-zig" = .{ .@"raylib-zig" = .{
.url = "https://github.com/Not-Nik/raylib-zig/archive/devel.tar.gz", .url = "https://github.com/Not-Nik/raylib-zig/archive/devel.tar.gz",
.hash = "12000000000000000000000000000000000000000000000000000000000000000000", .hash = "'$HASH'",
}, },
}, },
.paths = .{""}, .paths = .{""},
} }' >> build.zig.zon
' >> build.zig.zon
echo "Please manually update the dependency hash!"
mkdir src mkdir src
cp ../examples/core/basic_window.zig src/main.zig cp ../examples/core/basic_window.zig src/main.zig