Something went wrong. Try again.
Homebrew tap for XR (VR/AR/MR) software.
homebrew xr linux vr
Something went wrong. Try again.
856 B · 33 lines
Nushell
at main
12345678910111213141516171819202122232425262728293031323334#!/usr/bin/env nu# SPDX-License-Identifier: AGPL-3.0-only# Copyright (c) 2026 MatrixFurry <matrix@matrixfurry.com>
const formula_path = path self ../Formulaconst template_path = path self ./template/formula.rb
const cmake = [ 'system "cmake" "-S" "." "-B" "build" *std_cmake_args' 'system "cmake" "--build" "build"' 'system "cmake" "--install" "build"']
const cargo = [ 'system "cargo" "install" *std_cargo_args(features: "example-feature-flag")']
export def main [ name: string type: string] { let install_template = match $type { "cmake" => $cmake "cargo" => $cargo _ => {error make -u "Choose a valid template type."} } | str join "\n"
open $template_path | str replace "@CLASS@" ($name | str pascal-case) | str replace "@INSTALL@" $install_template | save ($formula_path | path join ($name ++ ".rb"))}