-
Notifications
You must be signed in to change notification settings - Fork 1
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
5 changed files
with
19 additions
and
15 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,6 +1,6 @@ | ||
[package] | ||
name = "calcit" | ||
version = "0.8.53" | ||
version = "0.8.54" | ||
authors = ["jiyinyiyong <[email protected]>"] | ||
edition = "2021" | ||
license = "MIT" | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
//! CLI tool to download packages from github, | ||
//! packages are defined in `package.cirru` file | ||
//! packages are defined in `deps.cirru` file | ||
//! | ||
//! files are stored in `~/.config/calcit/modules/`. | ||
|
@@ -53,14 +53,14 @@ struct CliArgs { | |
} | ||
|
||
pub fn main() -> Result<(), String> { | ||
// parse package.cirru | ||
// parse deps.cirru | ||
|
||
let cli_matches = parse_cli(); | ||
|
||
let options: CliArgs = CliArgs { | ||
input: cli_matches | ||
.get_one::<String>("input") | ||
.unwrap_or(&"package.cirru".to_string()) | ||
.unwrap_or(&"deps.cirru".to_string()) | ||
.to_string(), | ||
ci: cli_matches.get_flag("ci"), | ||
verbose: cli_matches.get_flag("verbose"), | ||
|
@@ -77,9 +77,18 @@ pub fn main() -> Result<(), String> { | |
|
||
download_deps(deps.dependencies, &options)?; | ||
|
||
Ok(()) | ||
} else if Path::new("package.cirru").exists() { | ||
// be compatible with old name | ||
let content = fs::read_to_string("package.cirru").map_err(|e| e.to_string())?; | ||
let parsed = cirru_edn::parse(&content)?; | ||
let deps: PackageDeps = parsed.try_into()?; | ||
|
||
download_deps(deps.dependencies, &options)?; | ||
|
||
Ok(()) | ||
} else { | ||
eprintln!("Error: no package.cirru found!"); | ||
eprintln!("Error: no deps.cirru found!"); | ||
std::process::exit(1); | ||
} | ||
} | ||
|
@@ -206,12 +215,7 @@ fn parse_cli() -> clap::ArgMatches { | |
.version(CALCIT_VERSION) | ||
.author("Jon. <[email protected]>") | ||
.about("Calcit Deps") | ||
.arg( | ||
clap::Arg::new("input") | ||
.help("entry file path") | ||
.default_value("package.cirru") | ||
.index(1), | ||
) | ||
.arg(clap::Arg::new("input").help("entry file path").default_value("deps.cirru").index(1)) | ||
.arg( | ||
clap::Arg::new("verbose") | ||
.help("verbose mode") | ||
|