Skip to content

Commit

Permalink
chore: release v0.5.0 (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
frol authored Nov 20, 2023
1 parent ed944de commit 1a7e710
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions cargo-near/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.5.0](https://github.com/near/cargo-near/compare/cargo-near-v0.4.1...cargo-near-v0.5.0) - 2023-11-20

### Added
- New command to initialize a new smart contract project ([#117](https://github.com/near/cargo-near/pull/117))

### Other
- update `near-sdk`, `near-abi`, `borsh` version ([#109](https://github.com/near/cargo-near/pull/109))

## [0.4.1](https://github.com/near/cargo-near/compare/cargo-near-v0.4.0...cargo-near-v0.4.1) - 2023-10-19

### Added
Expand Down
2 changes: 1 addition & 1 deletion cargo-near/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-near"
version = "0.4.1"
version = "0.5.0"
authors = ["Near Inc <[email protected]>"]
edition = "2021"
rust-version = "1.70.0"
Expand Down
25 changes: 19 additions & 6 deletions cargo-near/src/commands/new/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ impl NewContext {
scope: &<New as interactive_clap::ToInteractiveClapContextScope>::InteractiveClapContextScope,
) -> color_eyre::eyre::Result<Self> {
let project_dir: &std::path::Path = scope.project_dir.as_ref();

if project_dir.exists() {
return Err(color_eyre::eyre::eyre!(
"Destination `{}` already exists. Refusing to overwrite existing project.",
project_dir.display()
));
}

let project_name = project_dir
.file_name()
.wrap_err("Could not extract project name from project path")?
Expand All @@ -43,12 +51,17 @@ impl NewContext {
.output()
.wrap_err("Failed to execute process: `git init`")?;

println!("New project is created at '{}'\n", project_dir.display());
println!("Now you can build, deploy, and finish CI setup for automatic deployment:");
println!("1. `cargo near build`");
println!("2. `cargo test`");
println!("3. `cargo near deploy`");
println!("4. Configure `NEAR_CONTRACT_STAGING_*` and `NEAR_CONTRACT_PRODUCTION_*` variables and secrets on GitHub to enable automatic deployment to staging and production. See more details in `.github/workflow/*` files.");
println!("New project is created at '{}'.\n", project_dir.display());
println!("Now you can build, test, and deploy your project using cargo-near:");
println!(" * `cargo near build`");
println!(" * `cargo test`");
println!(" * `cargo near deploy`");
println!(
"Your new project has preconfigured automations for CI and CD, just configure \
`NEAR_CONTRACT_STAGING_*` and `NEAR_CONTRACT_PRODUCTION_*` variables and secrets \
on GitHub to enable automatic deployment to staging and production. See more \
details in `.github/workflow/*` files.\n"
);

Ok(Self)
}
Expand Down
4 changes: 2 additions & 2 deletions cargo-near/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn main() -> CliResult {
interactive_clap::ResultFromCli::Ok(cli_cmd)
| interactive_clap::ResultFromCli::Cancel(Some(cli_cmd)) => {
eprintln!(
"Your console command:\n{console_command_path} {}",
"Here is the console command if you ever need to re-run it again:\n{console_command_path} {}",
shell_words::join(cli_cmd.to_cli_args())
);
return Ok(());
Expand All @@ -55,7 +55,7 @@ fn main() -> CliResult {
interactive_clap::ResultFromCli::Err(optional_cli_cmd, err) => {
if let Some(cli_cmd) = optional_cli_cmd {
eprintln!(
"Your console command:\n{console_command_path} {}",
"Here is the console command if you ever need to re-run it again:\n{console_command_path} {}\n",
shell_words::join(cli_cmd.to_cli_args())
);
}
Expand Down

0 comments on commit 1a7e710

Please sign in to comment.