Skip to content

Commit

Permalink
Fix autocorrect init command for node.
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Jul 31, 2023
1 parent 8dfc3e4 commit 6dd48e0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test\:node:
cd autocorrect-node && yarn && yarn build && yarn test
test\:node\:cli:
cd autocorrect-node && yarn && yarn build
cd tests/node-cli-test && yarn upgrade autocorrect-node && yarn autocorrect --lint
cd tests/node-cli-test && yarn upgrade autocorrect-node && yarn autocorrect init
test\:python:
cd autocorrect-py && python3 -m pip install . && python3 -m pytest
test\:ruby:
Expand Down
7 changes: 3 additions & 4 deletions autocorrect-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ walkdir = "2.3.2"
# Request features:
# - blocking - for blocking request
# - rustls-tls - for use native rustls without system openssl dependency
reqwest = {version = "0.11.18", features = ["rustls-tls"], default-features = false, optional = true}
tokio = {version = "1", features = ["macros", "sync", "rt", "rt-multi-thread", "time"], default-features = false, optional = true}
reqwest = {version = "0.11.18", features = ["rustls-tls"], default-features = false}
tokio = {version = "1", features = ["macros", "sync", "rt", "rt-multi-thread", "time"], default-features = false}

# Self Update
# - archive-tar + compression-flate2 - for tar.gz
Expand All @@ -38,8 +38,7 @@ self_update = {version = "0.30.0", features = ["archive-tar", "compression-flate
sudo = {version = "0.5", optional = true}

[features]
default = ["update", "init"]
init = ["reqwest", "tokio"]
default = ["update"]
update = ["self_update", "sudo"]

[profile.release]
Expand Down
1 change: 0 additions & 1 deletion autocorrect-cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ pub(crate) struct Cli {

#[derive(Debug, Subcommand, Clone)]
pub(crate) enum Commands {
#[cfg(feature = "init")]
#[command(name = "init", about = "Initialize AutoCorrect config file.")]
Init {
#[clap(
Expand Down
4 changes: 1 addition & 3 deletions autocorrect-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ use std::path::Path;
use std::time::SystemTime;

mod cli;
mod initializer;
mod logger;
mod progress;

#[cfg(feature = "init")]
mod initializer;
#[cfg(feature = "update")]
mod update;

Expand Down Expand Up @@ -57,7 +56,6 @@ where
}

match cli.command {
#[cfg(feature = "init")]
Some(cli::Commands::Init { local, force }) => {
initializer::run(&cli, &initializer::InitOption { force, local }).await;
return;
Expand Down

0 comments on commit 6dd48e0

Please sign in to comment.