Skip to content

Allow for renamed package #147

Description

@vic1707

First, thank you for rust-script its awesome !

I have a script with the following script named display-tests

//! Requires library SDL2 to be installed
//! See: <https://docs.rs/embedded-graphics-simulator/latest/embedded_graphics_simulator/#setup>
//! ```cargo
//! [package]
//! name = "ceceti"
//! version = "0.0.0"
//! edition = "2021"
//!
//! [dependencies]
//! embedded-graphics-simulator = "0.7.0"
//! embedded-graphics = { version = "0.8.1", default-features = false, features = [
//!     "defmt",
//! ] }
//! embedded-menu = { version = "0.6.1", default-features = false }
//! embedded-layout = "*" ## sub dep of embedded-menu
//! ```
extern crate embedded_graphics_simulator;
extern crate embedded_graphics;
/* Modules */
#[path = "../src/menu.rs"]
mod menu;
/* Crate imports */
use menu::get_menu;
/* Dependencies */
use embedded_graphics::{pixelcolor::BinaryColor, prelude::Size, Drawable as _};
use embedded_graphics_simulator::{
	BinaryColorTheme, OutputSettingsBuilder, SimulatorDisplay, Window,
};

fn main() {
	let mut display = SimulatorDisplay::<BinaryColor>::new(Size::new(128, 64));
	let output_settings = OutputSettingsBuilder::new()
		.theme(BinaryColorTheme::OledBlue)
		.build();
	let mut window = Window::new("ceceti screen", &output_settings);

    // Menu
    let mut menu = get_menu();
	
    menu.update(&display);
	menu.draw(&mut display).unwrap();
    window.show_static(&display);
}

but the name field isn't used by rust-script

Image Image

Can we be allowed to override the package name with the Cargo.toml block, my menu module uses env!("CARGO_CRATE_NAME") so instead of

Image

I get

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions