Skip to content

Commit

Permalink
Amend
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Jan 22, 2025
1 parent 8316daf commit d715cb5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/compile_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ impl Display for CompileError<'_> {
}
DuplicateUnexport { variable } => {
write!(f, "Variable `{variable}` is unexported multiple times")
},
ExitMessageAndNoExitMessageAttribute { recipe } =>write!(
}
ExitMessageAndNoExitMessageAttribute { recipe } => write!(
f,
"Recipe `{recipe}` has both `[exit-message]` and `[no-exit-message]` attributes"
),
Expand Down
13 changes: 6 additions & 7 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -951,20 +951,19 @@ impl<'run, 'src> Parser<'run, 'src> {
}));
}

let working_directory = attributes.contains(AttributeDiscriminant::WorkingDirectory);

if working_directory && attributes.contains(AttributeDiscriminant::NoCd) {
if attributes.contains(AttributeDiscriminant::WorkingDirectory)
&& attributes.contains(AttributeDiscriminant::NoCd)
{
return Err(
name.error(CompileErrorKind::NoCdAndWorkingDirectoryAttribute {
recipe: name.lexeme(),
}),
);
}

let no_exit_message_attr = attributes.contains(AttributeDiscriminant::ExitMessage);
let exit_message_attr = attributes.contains(AttributeDiscriminant::NoExitMessage);

if no_exit_message_attr && exit_message_attr {
if attributes.contains(AttributeDiscriminant::ExitMessage)
&& attributes.contains(AttributeDiscriminant::NoExitMessage)
{
return Err(
name.error(CompileErrorKind::ExitMessageAndNoExitMessageAttribute {
recipe: name.lexeme(),
Expand Down

0 comments on commit d715cb5

Please sign in to comment.