Skip to content

Commit 2212e5f

Browse files
committed
Hello Scarb! πŸ’πŸŽ‰
1 parent 503b1d8 commit 2212e5f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+154
-154
lines changed

β€ŽCargo.lock

+38-38
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€ŽCargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[workspace]
22
members = [
3-
"murek",
3+
"scarb",
44
"utils/create-output-dir"
55
]
66

β€Žmurek/Cargo.toml β€Žscarb/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "murek"
2+
name = "scarb"
33
version.workspace = true
44
edition.workspace = true
55
rust-version.workspace = true

β€Žmurek/src/bin/murek/args.rs β€Žscarb/src/bin/scarb/args.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ use std::ffi::OsString;
66
use std::path::PathBuf;
77

88
use clap::{Parser, Subcommand};
9-
use murek::metadata::MetadataVersion;
9+
use scarb::metadata::MetadataVersion;
1010

1111
/// Cairo's project manager.
1212
#[derive(Parser, Clone, Debug)]
1313
#[command(author, version, about)]
1414
pub struct Args {
15-
/// Override path to a directory containing a **Murek.toml** file.
16-
#[arg(long, env = "MUREK_MANIFEST_PATH")]
15+
/// Override path to a directory containing a **Scarb.toml** file.
16+
#[arg(long, env = "SCARB_MANIFEST_PATH")]
1717
pub manifest_path: Option<PathBuf>,
1818

1919
/// Logging verbosity.
@@ -38,13 +38,13 @@ pub enum Command {
3838
Clean,
3939
/// List installed commands.
4040
Commands,
41-
/// Print path to current **Murek.toml** file to standard output.
41+
/// Print path to current **Scarb.toml** file to standard output.
4242
ManifestPath,
4343
/// Output the resolved dependencies of a package, the concrete used versions including
4444
/// overrides, in machine-readable format.
4545
Metadata(MetadataArgs),
4646

47-
/// External command (`murek-*` executable).
47+
/// External command (`scarb-*` executable).
4848
#[command(external_subcommand)]
4949
External(Vec<OsString>),
5050
}

β€Žmurek/src/bin/murek/commands/add.rs β€Žscarb/src/bin/scarb/commands/add.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use anyhow::Result;
2-
use murek::core::Config;
2+
use scarb::core::Config;
33

44
#[tracing::instrument(skip_all, level = "info")]
55
pub fn run(_conf: &Config) -> Result<()> {

β€Žmurek/src/bin/murek/commands/build.rs β€Žscarb/src/bin/scarb/commands/build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use anyhow::Result;
2-
use murek::core::Config;
2+
use scarb::core::Config;
33

4-
use murek::ops;
4+
use scarb::ops;
55

66
#[tracing::instrument(skip_all, level = "info")]
77
pub fn run(config: &Config) -> Result<()> {

β€Žmurek/src/bin/murek/commands/clean.rs β€Žscarb/src/bin/scarb/commands/clean.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use anyhow::Result;
2-
use murek::core::Config;
2+
use scarb::core::Config;
33

4-
use murek::ops;
4+
use scarb::ops;
55

66
#[tracing::instrument(skip_all, level = "info")]
77
pub fn run(config: &Config) -> Result<()> {

β€Žmurek/src/bin/murek/commands/commands.rs β€Žscarb/src/bin/scarb/commands/commands.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use anyhow::Result;
22

3-
use murek::core::Config;
3+
use scarb::core::Config;
44

55
#[tracing::instrument(skip_all, level = "info")]
66
pub fn run(_conf: &Config) -> Result<()> {

β€Žmurek/src/bin/murek/commands/external.rs β€Žscarb/src/bin/scarb/commands/external.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use std::ffi::OsString;
22

33
use anyhow::{anyhow, Result};
44

5-
use murek::core::Config;
6-
use murek::ops::execute_external_subcommand;
5+
use scarb::core::Config;
6+
use scarb::ops::execute_external_subcommand;
77

88
#[tracing::instrument(skip_all, level = "info")]
99
pub fn run(args: Vec<OsString>, config: &Config) -> Result<()> {

β€Žmurek/src/bin/murek/commands/manifest_path.rs β€Žscarb/src/bin/scarb/commands/manifest_path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use anyhow::Result;
22

3-
use murek::core::Config;
3+
use scarb::core::Config;
44

55
#[tracing::instrument(skip_all, level = "info")]
66
pub fn run(config: &Config) -> Result<()> {

β€Žmurek/src/bin/murek/commands/metadata.rs β€Žscarb/src/bin/scarb/commands/metadata.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use anyhow::{Context, Result};
22

3-
use murek::core::Config;
4-
use murek::metadata::{Metadata, MetadataOptions};
5-
use murek::ops;
3+
use scarb::core::Config;
4+
use scarb::metadata::{Metadata, MetadataOptions};
5+
use scarb::ops;
66

77
use crate::args::MetadataArgs;
88

β€Žmurek/src/bin/murek/commands/mod.rs β€Žscarb/src/bin/scarb/commands/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use anyhow::Result;
44

5-
use murek::core::Config;
5+
use scarb::core::Config;
66

77
use crate::args::Command;
88

β€Žmurek/src/bin/murek/main.rs β€Žscarb/src/bin/scarb/main.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ use tracing_subscriber::fmt::format::FmtSpan;
55
use tracing_subscriber::EnvFilter;
66

77
use args::Args;
8-
use murek::core::Config;
9-
use murek::dirs::AppDirs;
10-
use murek::ops;
8+
use scarb::core::Config;
9+
use scarb::dirs::AppDirs;
10+
use scarb::ops;
1111

1212
mod args;
1313
mod commands;
@@ -20,7 +20,7 @@ fn main() -> Result<()> {
2020
.with_env_filter(
2121
EnvFilter::builder()
2222
.with_default_directive(args.verbose.log_level_filter().as_trace().into())
23-
.with_env_var("MUREK_LOG")
23+
.with_env_var("SCARB_LOG")
2424
.from_env_lossy(),
2525
)
2626
.init();

β€Žmurek/src/core/config.rs β€Žscarb/src/core/config.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use which::which_in;
1010
use crate::core::Workspace;
1111
use crate::dirs::AppDirs;
1212
use crate::internal::fsx::{GuardedExistedPathBuf, GuardedExistedPathBufOpts};
13-
use crate::MUREK_ENV;
13+
use crate::SCARB_ENV;
1414

1515
pub type TargetDir = GuardedExistedPathBuf<'static>;
1616

@@ -60,19 +60,19 @@ impl Config {
6060
self.app_exe
6161
.get_or_try_init(|| {
6262
let from_env = || -> Result<PathBuf> {
63-
// Try re-using the `murek` set in the environment already.
64-
// This allows commands that use Murek as a library to inherit
65-
// (via `murek <subcommand>`) or set (by setting `$MUREK`) a correct path
66-
// to `murek` when the current exe is not actually murek (e.g. `murek-*` binaries).
67-
env::var_os(MUREK_ENV)
63+
// Try re-using the `scarb` set in the environment already.
64+
// This allows commands that use Scarb as a library to inherit
65+
// (via `scarb <subcommand>`) or set (by setting `$SCARB`) a correct path
66+
// to `scarb` when the current exe is not actually scarb (e.g. `scarb-*` binaries).
67+
env::var_os(SCARB_ENV)
6868
.map(PathBuf::from)
69-
.ok_or_else(|| anyhow!("${MUREK_ENV} not set"))?
69+
.ok_or_else(|| anyhow!("${SCARB_ENV} not set"))?
7070
.canonicalize()
7171
.map_err(Into::into)
7272
};
7373

7474
let from_current_exe = || -> Result<PathBuf> {
75-
// Try fetching the path to `murek` using `env::current_exe()`.
75+
// Try fetching the path to `scarb` using `env::current_exe()`.
7676
// The method varies per operating system and might fail; in particular,
7777
// it depends on `/proc` being mounted on Linux, and some environments
7878
// (like containers or chroots) may not have that available.
@@ -84,8 +84,8 @@ impl Config {
8484
// If `argv[0]` has one component, it must have come from a `PATH` lookup,
8585
// so probe `PATH` in that case.
8686
// Otherwise, it has multiple components and is either:
87-
// - a relative path (e.g., `./murek`, `target/debug/murek`), or
88-
// - an absolute path (e.g., `/usr/local/bin/murek`).
87+
// - a relative path (e.g., `./scarb`, `target/debug/scarb`), or
88+
// - an absolute path (e.g., `/usr/local/bin/scarb`).
8989
// In either case, [`Path::canonicalize`] will return the full absolute path
9090
// to the target if it exists.
9191
let argv0 = env::args_os()
@@ -99,7 +99,7 @@ impl Config {
9999
from_env()
100100
.or_else(|_| from_current_exe())
101101
.or_else(|_| from_argv())
102-
.context("could not get the path to murek executable")
102+
.context("could not get the path to scarb executable")
103103
})
104104
.map(AsRef::as_ref)
105105
}

β€Žmurek/src/core/manifest/mod.rs β€Žscarb/src/core/manifest/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::core::source::SourceId;
1212

1313
mod toml;
1414

15-
pub const MANIFEST_FILE_NAME: &str = "Murek.toml";
15+
pub const MANIFEST_FILE_NAME: &str = "Scarb.toml";
1616

1717
/// Contains all the information about a package, as loaded from the manifest file.
1818
///

β€Žmurek/src/core/manifest/toml.rs β€Žscarb/src/core/manifest/toml.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ use crate::internal::fsx;
1616

1717
use super::Manifest;
1818

19-
/// This type is used to deserialize `Murek.toml` files.
19+
/// This type is used to deserialize `Scarb.toml` files.
2020
#[derive(Debug, Default, Deserialize, Serialize)]
2121
#[serde(rename_all = "kebab-case")]
2222
pub struct TomlManifest {
2323
pub package: Option<Box<TomlPackage>>,
2424
pub dependencies: Option<BTreeMap<SmolStr, TomlDependency>>,
2525
}
2626

27-
/// Represents the `package` section of a `Murek.toml`.
27+
/// Represents the `package` section of a `Scarb.toml`.
2828
#[derive(Debug, Deserialize, Serialize)]
2929
#[serde(rename_all = "kebab-case")]
3030
pub struct TomlPackage {

β€Žmurek/src/core/mod.rs β€Žscarb/src/core/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Core datastructures describing Murek workspace state.
1+
//! Core datastructures describing Scarb workspace state.
22
//!
33
//! For read operations and workspace mutations, see [`crate::ops`] module.
44
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

β€Žmurek/src/dirs.rs β€Žscarb/src/dirs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub struct AppDirs {
1616

1717
impl AppDirs {
1818
pub fn std() -> Result<Self> {
19-
let pd = ProjectDirs::from("co", "starkware", "murek").ok_or_else(|| {
19+
let pd = ProjectDirs::from("co", "starkware", "scarb").ok_or_else(|| {
2020
anyhow!("no valid home directory path could be retrieved from the operating system")
2121
})?;
2222

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

β€Žmurek/src/lib.rs β€Žscarb/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ pub mod ops;
1414
mod resolver;
1515
mod sources;
1616

17-
pub const MUREK_ENV: &str = "MUREK";
17+
pub const SCARB_ENV: &str = "SCARB";
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

β€Žmurek/src/ops/mod.rs β€Žscarb/src/ops/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! All read operations and mutations available with Murek workspace.
1+
//! All read operations and mutations available with Scarb workspace.
22
//!
33
//! For datastructures describing the state, see [`crate::core`] module.
44
File renamed without changes.

β€Žmurek/src/ops/subcommands.rs β€Žscarb/src/ops/subcommands.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::process::Command;
66
use anyhow::{bail, Context, Result};
77

88
use crate::core::Config;
9-
use crate::MUREK_ENV;
9+
use crate::SCARB_ENV;
1010

1111
#[tracing::instrument(level = "debug", skip(config))]
1212
pub fn execute_external_subcommand(cmd: &str, args: &[&OsStr], config: &Config) -> Result<()> {
@@ -21,7 +21,7 @@ pub fn execute_external_subcommand(cmd: &str, args: &[&OsStr], config: &Config)
2121

2222
let exit_status = Command::new(&cmd)
2323
.args(args)
24-
.env(MUREK_ENV, config.app_exe()?)
24+
.env(SCARB_ENV, config.app_exe()?)
2525
.env("PATH", config.dirs.path_env())
2626
.spawn()
2727
.with_context(|| format!("failed to spawn subcommand: {}", cmd.display()))?
@@ -36,7 +36,7 @@ pub fn execute_external_subcommand(cmd: &str, args: &[&OsStr], config: &Config)
3636
}
3737

3838
fn find_external_subcommand(cmd: &str, config: &Config) -> Option<PathBuf> {
39-
let command_exe = format!("murek-{}{}", cmd, env::consts::EXE_SUFFIX);
39+
let command_exe = format!("scarb-{}{}", cmd, env::consts::EXE_SUFFIX);
4040
config
4141
.dirs
4242
.path_dirs
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
Β (0)