feat: introduced nix packaging and path-based binary resolution
- Add comprehensive Nix flake definitions, derivations, modules, and CI workflows. - Update tests and executables to resolve binaries from PATH rather than absolute paths. - Ensure byte reproducibility and zeroed timestamps in embedded dashboard archives. - Add handling for Nix-managed installations in CLI update checks.
This commit is contained in:
@@ -5,7 +5,7 @@ import { spawn } from "node:child_process";
|
||||
import * as fs from "node:fs/promises";
|
||||
import * as os from "node:os";
|
||||
import * as path from "node:path";
|
||||
import { $env, Snowflake } from "@oh-my-pi/pi-utils";
|
||||
import { $env, $which, Snowflake } from "@oh-my-pi/pi-utils";
|
||||
|
||||
/**
|
||||
* Returns the user's preferred editor command, or a platform default.
|
||||
@@ -56,7 +56,7 @@ export async function openInEditor(
|
||||
const child =
|
||||
process.platform === "win32"
|
||||
? spawn(editor, [...editorArgs, tmpFile], { stdio, shell: true })
|
||||
: spawn("/bin/sh", ["-c", `${editorCmd} "$1"`, "sh", tmpFile], { stdio });
|
||||
: spawn($which("sh") ?? "sh", ["-c", `${editorCmd} "$1"`, "sh", tmpFile], { stdio });
|
||||
const { promise, reject, resolve } = Promise.withResolvers<number>();
|
||||
child.once("exit", (code, signal) => resolve(code ?? (signal ? -1 : 0)));
|
||||
child.once("error", error => reject(error));
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
parseNumstat,
|
||||
} from "../commit/git/diff";
|
||||
import type { FileDiff, FileHunks, NumstatEntry } from "../commit/types";
|
||||
import { REJECT_PROMPT_COMMAND } from "../exec/non-interactive-env";
|
||||
import { ToolAbortError, ToolError, throwIfAborted } from "../tools/tool-errors";
|
||||
|
||||
// ════════════════════════════════════════════════════════════════════════════
|
||||
@@ -199,7 +200,7 @@ const GIT_NON_INTERACTIVE_ENV = {
|
||||
GIT_TERMINAL_PROMPT: "0",
|
||||
LC_ALL: undefined,
|
||||
LC_MESSAGES: "C",
|
||||
SSH_ASKPASS: "/usr/bin/false",
|
||||
SSH_ASKPASS: REJECT_PROMPT_COMMAND,
|
||||
} satisfies Record<string, string | undefined>;
|
||||
const GH_NON_INTERACTIVE_ENV = {
|
||||
...GIT_NON_INTERACTIVE_ENV,
|
||||
|
||||
Reference in New Issue
Block a user