Skip to content

Commit

Permalink
Stale message includes bin/pks if it exists (#206)
Browse files Browse the repository at this point in the history
* stale message includes bin/pks if it exists

* including dotslash installation instructions
  • Loading branch information
perryqh authored Jun 24, 2024
1 parent a3ac42a commit beddd3e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ You can add `path/to/packs` to your `PATH` so it's available in every terminal s
## Option 3 (coming soon):
I'm looking into installing via `brew` or as a native ruby gem extension. More coming soon!

## Option 4:
- Install [dotslash](https://dotslash-cli.com/docs/installation/)
- Download the latest packs release dotslash `pks` file. Example: https://github.com/alexevanczuk/packs/releases/download/v0.2.8/pks
- Save the `pks` file to your ruby project's bin/ directory. You'll then have a `bin/pks` file in your project.
- Use `bin/pks` to execute the CLI.
1 change: 1 addition & 0 deletions src/packs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
pub mod cli;

// Module declarations
pub(crate) mod bin_locater;
pub(crate) mod caching;
pub(crate) mod checker;
pub(crate) mod configuration;
Expand Down
9 changes: 9 additions & 0 deletions src/packs/bin_locater.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use std::path::Path;

pub fn packs_bin_name() -> String {
if Path::new("bin/pks").exists() {
"bin/pks".to_string()
} else {
"packs".to_string()
}
}
4 changes: 3 additions & 1 deletion src/packs/checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use std::fmt::Formatter;
use std::{collections::HashSet, path::PathBuf};
use tracing::debug;

use super::bin_locater;
use super::reference_extractor::get_all_references;

#[derive(PartialEq, Clone, Eq, Hash, Debug)]
Expand Down Expand Up @@ -90,7 +91,8 @@ impl CheckAllResult {
if !self.stale_violations.is_empty() {
writeln!(
f,
"There were stale violations found, please run `packs update`"
"There were stale violations found, please run `{} update`",
bin_locater::packs_bin_name(),
)?;
}

Expand Down

0 comments on commit beddd3e

Please sign in to comment.