Skip to content

Commit

Permalink
chore: address linter complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianoliveira committed Jun 12, 2023
1 parent c40e4dc commit c60e2a1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/cli/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl Command for WatchCommand {

watcher::events(
|file_changed| {
if let Some(rules) = self.watches.watch(&file_changed) {
if let Some(rules) = self.watches.watch(file_changed) {
stdout::verbose(
&format!("Triggered by change in: {}", file_changed),
self.verbose,
Expand Down
4 changes: 2 additions & 2 deletions src/cli/watch_non_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl Command for WatchNonBlockCommand {

watcher::events(
|file_changed| {
if let Some(rules) = self.watches.watch(&file_changed) {
if let Some(rules) = self.watches.watch(file_changed) {
stdout::verbose(
&format!("Triggered by change in: {}", file_changed),
self.verbose,
Expand All @@ -53,7 +53,7 @@ impl Command for WatchNonBlockCommand {
));
}

if let Err(err) = worker.schedule(rules.clone(), file_changed) {
if let Err(err) = worker.schedule(rules, file_changed) {
stdout::error(&format!("failed to initiate next run: {:?}", err));
}
}
Expand Down
10 changes: 5 additions & 5 deletions tests/integration/specs/watch-command-test.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/env bash
source "$HELPERS"

test "it watches the configured rules"

# skip if in CI
if [ -n "$CI" ]; then
echo "skipping watch-command-test.sh in CI no trigger is possible"
exit 0
fi

test "it watches the configured rules"

echo "
- name: run simple command
run: echo 'test1'
Expand All @@ -17,10 +17,10 @@ echo "
- name: run different command
run: echo '__placeholder__' | sed s/placeholder/second_commmand/g
change: \"$WORKDIR/**\"
" > $WORKDIR/.onwatch.yaml
" > "$WORKDIR"/.onwatch.yaml

touch $WORKDIR/test.txt
touch $WORKDIR/output.txt
touch "$WORKDIR"/test.txt
touch "$WORKDIR"/output.txt
# $TEST_DIR/funzzy --config $WORKDIR/.onwatch.yaml &
"$TEST_DIR"/funzzy watch \
--config "$WORKDIR"/.onwatch.yaml >> "$WORKDIR"/output.txt &
Expand Down

0 comments on commit c60e2a1

Please sign in to comment.