Skip to content

Commit

Permalink
fix: envcli -> envx
Browse files Browse the repository at this point in the history
  • Loading branch information
alexng353 committed Sep 2, 2024
1 parent 54d5856 commit 7765f05
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ Commands:
decrypt Decrypt a string using GPG
encrypt Encrypt a string using GPG
export Export a public or secret key
gen Generate a key using GPG Saves the key to ~/.envcli/keys/<fingerprint>
gen Generate a key using GPG Saves the key to ~/.envx/keys/<fingerprint>
import Import ascii armored keys from a file
link Get all environment variables for a project
list-keys List all keys in the config
run Run a local command using variables from the active environment
set Set a variable (Interactive)
shell Open a subshell with envcli variables available
shell Open a subshell with envx variables available
sign Sign a message with a key
unlink Unset the current project
unset Unset (delete) an environment variable
Expand Down
4 changes: 2 additions & 2 deletions src/commands/gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extern crate keyring;
use keyring::Error as KeyringError;

/// Generate a key using GPG
/// Saves the key to ~/.envcli/keys/<fingerprint>
/// Saves the key to ~/.config/envx/keys/<fingerprint>
#[derive(Parser)]
pub struct Args {
/// Interactive mode
Expand Down Expand Up @@ -193,7 +193,7 @@ pub async fn command(args: Args) -> Result<()> {
Err(_) => {
eprintln!("Failed to create user on API");
eprintln!("Continuing with generation...");
eprintln!("You can create a user later with `envcli upload`");
eprintln!("You can create a user later with `envx upload`");
}
};
}
Expand Down
4 changes: 2 additions & 2 deletions src/commands/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ pub async fn command(args: Args) -> Result<()> {
);
} else {
println!("A project is already linked to this directory");
println!(" Use `envcli unlink` to unlink the current project");
println!(" Or force a new project with `envcli link --force`");
println!(" Use `envx unlink` to unlink the current project");
println!(" Or force a new project with `envx link --force`");
println!("{} {}", "Current project:".green(), project.project_id);
return Ok(());
}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub async fn command(args: Args) -> Result<()> {
}

let mut all_variables = BTreeMap::<String, String>::new();
all_variables.insert("IN_ENVCLI_SHELL".to_owned(), "true".to_owned());
all_variables.insert("IN_ENVX_SHELL".to_owned(), "true".to_owned());

let variables =
crate::sdk::SDK::get_variables_pruned(&project_id, &key.fingerprint)
Expand Down
8 changes: 4 additions & 4 deletions src/commands/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use std::ffi::CStr;
#[cfg(target_os = "windows")]
use std::mem::zeroed;

/// Open a subshell with envcli variables available
/// Open a subshell with envx variables available
#[derive(Parser)]
pub struct Args {
/// Project ID
Expand Down Expand Up @@ -55,7 +55,7 @@ pub async fn command(args: Args) -> Result<()> {
}

let mut all_variables = BTreeMap::<String, String>::new();
all_variables.insert("IN_ENVCLI_SHELL".to_owned(), "true".to_owned());
all_variables.insert("IN_ENVX_SHELL".to_owned(), "true".to_owned());

let variables =
crate::sdk::SDK::get_variables_pruned(&project_id, &key.fingerprint)
Expand Down Expand Up @@ -85,7 +85,7 @@ pub async fn command(args: Args) -> Result<()> {
};

if !args.silent {
println!("Entering subshell with envcli variables available. Type 'exit' to exit.\n");
println!("Entering subshell with envx variables available. Type 'exit' to exit.\n");
}

// a bit janky :/
Expand All @@ -103,7 +103,7 @@ pub async fn command(args: Args) -> Result<()> {
.await
.context("Failed to wait for command")?;

println!("Exited subshell, envcli variables no longer available.");
println!("Exited subshell, envx variables no longer available.");
Ok(())
}

Expand Down
6 changes: 3 additions & 3 deletions src/utils/config.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// configuration path = ~/.config/envcli/config.json
// configuration path = ~/.config/envx/config.json

use super::key::Key;
use super::rpgp::get_vault_location;
Expand Down Expand Up @@ -227,10 +227,10 @@ impl Config {
}
}

/// Get the configuration path ~/.config/envcli/config.json
/// Get the configuration path ~/.config/envx/config.json
pub fn get_config_path() -> Result<PathBuf> {
let mut path = home_dir().context("Failed to get home directory")?;
path.push(".config/envcli/config.json");
path.push(".config/envx/config.json");
// if it doesn't exist, create it
if !path.exists() {
let default = serde_json::to_string_pretty(&Config::default())?;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/rpgp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub(crate) fn get_vault_location(
let path = home::home_dir()
.context("Failed to get home directory")?
.join(".config")
.join("envcli")
.join("envx")
.join("keys");

Ok(path)
Expand Down

0 comments on commit 7765f05

Please sign in to comment.