-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
52 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
use anyhow::Result; | ||
|
||
use crate::errors::ScarbResult; | ||
use scarb::core::Config; | ||
use scarb::ops; | ||
|
||
#[tracing::instrument(skip_all, level = "info")] | ||
pub fn run(config: &Config) -> Result<()> { | ||
pub fn run(config: &Config) -> ScarbResult<()> { | ||
let ws = ops::read_workspace(config.manifest_path(), config)?; | ||
ops::compile(&ws) | ||
ops::compile(&ws).map_err(Into::into) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
use anyhow::Result; | ||
use scarb::core::Config; | ||
|
||
use crate::errors::ScarbResult; | ||
use scarb::ops; | ||
|
||
#[tracing::instrument(skip_all, level = "info")] | ||
pub fn run(config: &Config) -> Result<()> { | ||
ops::clean(config) | ||
pub fn run(config: &Config) -> ScarbResult<()> { | ||
ops::clean(config).map_err(Into::into) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
use std::ffi::OsString; | ||
|
||
use anyhow::{anyhow, Result}; | ||
use anyhow::anyhow; | ||
|
||
use crate::errors::ScarbResult; | ||
use scarb::core::Config; | ||
use scarb::ops::execute_external_subcommand; | ||
|
||
#[tracing::instrument(skip_all, level = "info")] | ||
pub fn run(args: Vec<OsString>, config: &Config) -> Result<()> { | ||
pub fn run(args: Vec<OsString>, config: &Config) -> ScarbResult<()> { | ||
assert!(!args.is_empty()); | ||
let cmd = &args[0] | ||
.clone() | ||
.into_string() | ||
.map_err(|_| anyhow!("command name must be valid UTF-8"))?; | ||
let args = &args.iter().skip(1).map(AsRef::as_ref).collect::<Vec<_>>(); | ||
execute_external_subcommand(cmd, args, config) | ||
execute_external_subcommand(cmd, args, config).map_err(Into::into) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
use anyhow::Result; | ||
|
||
use crate::args::FmtArgs; | ||
use crate::errors::{ErrorWithExitCode, ScarbResult}; | ||
use scarb::core::Config; | ||
use scarb::ops; | ||
|
||
#[tracing::instrument(skip_all, level = "info")] | ||
pub fn run(args: FmtArgs, config: &Config) -> Result<()> { | ||
pub fn run(args: FmtArgs, config: &Config) -> ScarbResult<()> { | ||
let ws = ops::read_workspace(config.manifest_path(), config)?; | ||
match ops::format( | ||
|
||
if ops::format( | ||
ops::FmtOptions { | ||
check: args.check, | ||
pkg_name: args.package, | ||
color: !args.no_color, | ||
}, | ||
&ws, | ||
) { | ||
Ok(true) => Ok(()), | ||
_ => std::process::exit(1), | ||
)? { | ||
Ok(()) | ||
} else { | ||
Err(ErrorWithExitCode::code(1)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters