Skip to content
Closed
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
packages/muray/vendor/raylib-5.5**
41 changes: 41 additions & 0 deletions packages/muray/install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// @ts-check
import os from "node:os";
import { execSync } from "node:child_process";
import fs from "node:fs";
import process from "node:process";
const platform = os.platform();

if (platform !== "linux" && platform !== "darwin" && platform !== "win32") {
throw new Error(`Unsupported platform: ${platform}`);
}

const releases = {
linux: "linux_amd64.tar.gz",
darwin: "macos.tar.gz",
win32: "win64_msvc16.zip",
};

const url =
"https://github.com/raysan5/raylib/releases/download/5.5/raylib-5.5_" +
releases[platform];

const $ = (/**@type{string}*/ cmd) => execSync(cmd, { stdio: "inherit" });

if (
fs.existsSync("vendor/raylib-5.5_win64_msvc16") ||
fs.existsSync("vendor/raylib-5.5_linux_amd64") ||
fs.existsSync("vendor/raylib-5.5_macos")
) {
console.log("raylib already installed");
process.exit(0);
}

if (platform === "win32") {
$(`curl.exe --output raylib.zip -L "${url}"`);
$(`tar -xzf raylib.zip -C vendor`);
$(`del raylib.zip`);
} else {
$(`curl --output raylib.tar.gz -L "${url}"`);
$(`tar -xzf raylib.tar.gz -C vendor`);
$(`rm raylib.tar.gz`);
}
3 changes: 2 additions & 1 deletion packages/muray/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"install": "node-gyp rebuild"
"install": "node install.js",
"postinstall": "node-gyp rebuild"
},
"repository": {
"type": "git",
Expand Down
2,599 changes: 0 additions & 2,599 deletions packages/muray/vendor/raylib-5.5_linux_amd64/CHANGELOG

This file was deleted.

16 changes: 0 additions & 16 deletions packages/muray/vendor/raylib-5.5_linux_amd64/LICENSE

This file was deleted.

150 changes: 0 additions & 150 deletions packages/muray/vendor/raylib-5.5_linux_amd64/README.md

This file was deleted.

Loading