fix: ensure builtin plugins are built for the correct target

This commit is contained in:
nekename committed 2025-08-23 17:39:17 +01:00
1 parent 660313d41d
commit 9d200a3877
14 files changed
+16 -10

No files matched your search

@@ -3,9 +3,9 @@
"Description": "OpenDeck starter pack plugin",
"Author": "Aman Khanna (nekename)",
"Version": "2.5.1",
"CodePathWin": "opendeck-starterpack.exe",
"CodePathMac": "opendeck-starterpack-mac",
"CodePathLin": "opendeck-starterpack",
"CodePathWin": "windows/bin/opendeck-starterpack.exe",
"CodePathMac": "darwin/bin/opendeck-starterpack",
"CodePathLin": "linux/bin/opendeck-starterpack",
"Icon": "icons/plugin",
"Category": "OpenDeck",
"OS": [
@@ -3,8 +3,10 @@
import { copy } from "jsr:@std/fs";
import { join } from "jsr:@std/path";
if (Deno.args.length < 1) Deno.exit(1);
if (Deno.args.length < 2) Deno.exit(1);
const outDir = Deno.args[0];
const target = Deno.args[1];
try {
await Deno.remove(outDir, { recursive: true });
} catch (error: any) {
@@ -12,9 +14,6 @@ try {
throw error;
}
}
copy("files", outDir);
if (!(await new Deno.Command("cargo", { args: ["build", "--release"] }).spawn().status).success) Deno.exit(1);
const builtExec = Deno.build.os == "windows" ? "opendeck-starterpack.exe" : "opendeck-starterpack";
const targetExec = Deno.build.os == "windows" ? "opendeck-starterpack.exe" : Deno.build.os == "darwin" ? "opendeck-starterpack-mac" : "opendeck-starterpack";
copy(join("target", "release", builtExec), join(outDir, targetExec));
copy("assets", outDir);
if (!(await new Deno.Command("cargo", { args: ["install", "--path", ".", "--target", target, "--root", join(outDir, Deno.build.os)] }).spawn().status).success) Deno.exit(1);
+8 -1
View File
@@ -8,7 +8,14 @@ fn main() {
let out_dir = std::path::Path::new("target").join("plugins").join(entry.file_name());
fs::create_dir_all(&out_dir)?;
let status = std::process::Command::new("deno")
.args(["run", "--lock=target/deno.lock", "--allow-all", "build.ts", fs::canonicalize(out_dir)?.to_string_lossy().as_ref()])
.args([
"run",
"--lock=target/deno.lock",
"--allow-all",
"build.ts",
fs::canonicalize(out_dir)?.to_string_lossy().as_ref(),
&std::env::var("TARGET").unwrap(),
])
.current_dir(entry.path())
.status()?;
if !status.success() {