Skip to content

Commit

Permalink
[openscad-auto] Install openscad-auto normally.
Browse files Browse the repository at this point in the history
This avoids syntax errors until Rust supports the syntax in its tooling: rust-lang/cargo#12207 (comment)
  • Loading branch information
lgarron committed Nov 7, 2024
1 parent e765ee6 commit 47da2bc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 39 deletions.
26 changes: 4 additions & 22 deletions Formula/openscad-auto.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,11 @@ class OpenscadAuto < Formula
homepage "https://github.com/lgarron/scripts"
head "https://github.com/lgarron/scripts.git", :branch => "main"

# We'd add `openscad@snapshot` as a dependency, but that formula is a cask because of the associated app and casks can't be used as dependencies. :-/
depends_on "terminal-notifier"

# TODO: figure out how to depend on Rust nightly.
# depends_on "rust"

def caveats
<<~EOS
1. Make sure to run:
rustup toolchain install nightly
2. Completions cannot currently be automatically installed. Run:
openscad-auto --completions fish > ~/.config/fish/completions/openscad-auto.fish"
EOS
end
depends_on "rust" => :build

def install
bin.install "app-tools/openscad-auto.rs" => "openscad-auto"
# TODO
# generate_completions_from_executable(bin/"openscad-auto", "--completions")
# generate_completions_from_executable(system "cargo", "+nightly", "-Zscript", bin/"openscad-auto", "--completions")
# (fish_completion/"openscad-auto.fish").write Utils.safe_popen_read({ "SHELL" => "fish" }, "/Users/lgarron/.cache/cargo/bin/cargo", "+nightly", "-Zscript", "--", "openscad-auto", "--completions", "fish")
system "cargo", "install", "--bin", "openscad-auto", *std_cargo_args()

generate_completions_from_executable(bin/"openscad-auto", "--completions")
end
end
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ See [`./exported/`](./exported/) for files that must be manually exported/import
- `bash` (deprecated, except for bootstrapping)
- `fish`
- `bun` for TypeScript
- `cargo +nightly -Zscript`
- Rust
- Homebrew

## XDG Base Directory Spec
Expand Down
2 changes: 0 additions & 2 deletions rust-toolchain.toml

This file was deleted.

14 changes: 0 additions & 14 deletions scripts/app-tools/openscad-auto.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
#!/usr/bin/env -S cargo +nightly -Zscript --quiet --
---
[package]
edition = "2021"
[dependencies]
chrono = "0.4.38"
clap = { version = "4.5.20", features = ["derive"] }
clap_complete = "4.5.33"
script-helpers = "0.1.0"
shell-quote = "0.7.1"
---

// TODO: split out parts of this file into conveniences.

use chrono::Local;
use clap::{CommandFactory, Parser, ValueEnum};
use clap_complete::generator::generate;
Expand Down

0 comments on commit 47da2bc

Please sign in to comment.