Skip to content

Commit 3e346cf

Browse files
committed
rename: om hack -> om develop
1 parent dc585d3 commit 3e346cf

13 files changed

Lines changed: 36 additions & 36 deletions

File tree

bacon.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ command = [
9696
need_stdout = true
9797
allow_warnings = true
9898

99-
[jobs.hack]
99+
[jobs.develop]
100100
command = [
101101
"cargo",
102102
"run",
103103
"--color",
104104
"always",
105105
"--",
106-
"hack",
106+
"develop",
107107
".",
108108
]
109109
need_stdout = true

crates/omnix-cli/src/command/core.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub enum Command {
77

88
Init(super::init::InitCommand),
99

10-
Hack(super::hack::HackCommand),
10+
Develop(super::develop::DevelopCommand),
1111

1212
CI(super::ci::CICommand),
1313

@@ -26,7 +26,7 @@ impl Command {
2626
match self {
2727
Command::Show(cmd) => cmd.run().await,
2828
Command::Init(cmd) => cmd.run().await,
29-
Command::Hack(cmd) => cmd.run().await,
29+
Command::Develop(cmd) => cmd.run().await,
3030
Command::CI(cmd) => cmd.run(verbosity).await,
3131
Command::Health(cmd) => cmd.run().await,
3232
Command::Completion(cmd) => cmd.run(),
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ use std::path::PathBuf;
22

33
use clap::Parser;
44

5-
/// Prepare to hack on a flake project
5+
/// Prepare to hack (develop) on a flake project
66
#[derive(Parser, Debug)]
7-
pub struct HackCommand {
7+
pub struct DevelopCommand {
88
/// Directory of the project
99
#[arg(name = "DIR", default_value = ".")]
1010
dir: PathBuf,
@@ -24,17 +24,17 @@ enum Stage {
2424
PostShell,
2525
}
2626

27-
impl HackCommand {
27+
impl DevelopCommand {
2828
pub async fn run(&self) -> anyhow::Result<()> {
2929
tracing::info!(
3030
"⌨️ Preparing to develop project at {:}",
3131
self.dir.display()
3232
);
3333
let prj = omnix_develop::core::Project::new(&self.dir).await?;
3434
match self.stage {
35-
Some(Stage::PreShell) => omnix_develop::core::hack_on_pre_shell(&prj).await?,
36-
Some(Stage::PostShell) => omnix_develop::core::hack_on_post_shell(&prj).await?,
37-
None => omnix_develop::core::hack_on(&prj).await?,
35+
Some(Stage::PreShell) => omnix_develop::core::develop_on_pre_shell(&prj).await?,
36+
Some(Stage::PostShell) => omnix_develop::core::develop_on_post_shell(&prj).await?,
37+
None => omnix_develop::core::develop_on(&prj).await?,
3838
}
3939
Ok(())
4040
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pub mod ci;
22
pub mod completion;
33
pub mod core;
4-
pub mod hack;
4+
pub mod develop;
55
pub mod health;
66
pub mod init;
77
pub mod show;

crates/omnix-develop/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55
name = "omnix-develop"
66
version = "0.1.0"
77
repository = "https://github.com/juspay/omnix"
8-
description = "Implementation for the `om hack` command"
8+
description = "Implementation for the `om develop` command"
99
license = "Apache-2.0"
1010

1111
[lib]

crates/omnix-develop/src/config.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use omnix_common::config::OmConfig;
66
use crate::readme::Readme;
77

88
#[derive(Debug, Deserialize, Clone, Default)]
9-
pub struct HackConfig {
9+
pub struct DevelopConfig {
1010
pub readme: Readme,
1111
}
1212

@@ -16,9 +16,9 @@ pub struct CacheConfig {
1616
pub url: String,
1717
}
1818

19-
impl HackConfig {
19+
impl DevelopConfig {
2020
pub async fn from_flake(url: &FlakeUrl) -> anyhow::Result<Self> {
21-
let v = OmConfig::<Self>::from_flake_url(NixCmd::get().await, url, &["om.hack"])
21+
let v = OmConfig::<Self>::from_flake_url(NixCmd::get().await, url, &["om.develop"])
2222
.await?
2323
.config;
2424
let config = v.get("default").cloned().unwrap_or_default();

crates/omnix-develop/src/core.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,34 @@ use nix_rs::{flake::url::FlakeUrl, info::NixInfo};
55
use omnix_common::markdown::print_markdown;
66
use omnix_health::{check::caches::CachixCache, traits::Checkable, NixHealth};
77

8-
use crate::config::HackConfig;
8+
use crate::config::DevelopConfig;
99

10-
/// A project that an be hacked on locally.
10+
/// A project that an be developed on locally.
1111
pub struct Project {
1212
/// The directory of the project.
1313
pub dir: PathBuf,
1414
/// [FlakeUrl] corresponding to the project.
1515
pub flake: FlakeUrl,
16-
/// The hack configuration
17-
pub cfg: HackConfig,
16+
/// The develop configuration
17+
pub cfg: DevelopConfig,
1818
}
1919

2020
impl Project {
2121
pub async fn new(dir: &Path) -> anyhow::Result<Self> {
2222
let dir = dir.canonicalize()?;
2323
let flake: FlakeUrl = Into::<FlakeUrl>::into(dir.as_ref());
24-
let cfg = HackConfig::from_flake(&flake).await?;
24+
let cfg = DevelopConfig::from_flake(&flake).await?;
2525
Ok(Self { dir, flake, cfg })
2626
}
2727
}
2828

29-
pub async fn hack_on(prj: &Project) -> anyhow::Result<()> {
30-
hack_on_pre_shell(prj).await?;
31-
hack_on_post_shell(prj).await?;
29+
pub async fn develop_on(prj: &Project) -> anyhow::Result<()> {
30+
develop_on_pre_shell(prj).await?;
31+
develop_on_post_shell(prj).await?;
3232
Ok(())
3333
}
3434

35-
pub async fn hack_on_pre_shell(prj: &Project) -> anyhow::Result<()> {
35+
pub async fn develop_on_pre_shell(prj: &Project) -> anyhow::Result<()> {
3636
// Run relevant `om health` checks
3737
let health = NixHealth::from_flake(&prj.flake).await?;
3838
let nix_info = NixInfo::get()
@@ -78,7 +78,7 @@ pub async fn hack_on_pre_shell(prj: &Project) -> anyhow::Result<()> {
7878
Ok(())
7979
}
8080

81-
pub async fn hack_on_post_shell(prj: &Project) -> anyhow::Result<()> {
81+
pub async fn develop_on_post_shell(prj: &Project) -> anyhow::Result<()> {
8282
eprintln!();
8383
print_markdown(&prj.dir, prj.cfg.readme.get_markdown()).await?;
8484
Ok(())

crates/omnix-develop/src/readme.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use serde::Deserialize;
22

33
const DEFAULT: &str = r#"🍾 Welcome to the project
44
5-
*(Want to show custom instructions here? Add them to the `om.hack.default.readme` field in your `flake.nix` file)*
5+
*(Want to show custom instructions here? Add them to the `om.develop.default.readme` field in your `flake.nix` file)*
66
"#;
77

88
/// The README to display at the end.

doc/src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- [CLI](om/index.md)
88
- [Show](om/show.md)
99
- [Health](om/health.md)
10-
- [Hack](om/hack.md)
10+
- [Develop](om/develop.md)
1111
- [CI](om/ci.md)
1212
- [Init](om/init.md)
1313

doc/src/history.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### Enhancements
66

7-
- `om hack`: New command
7+
- `om develop`: New command
88
- `om init`
99
- Initial working version of `om init` command
1010
- `om health`

0 commit comments

Comments
 (0)