Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ br = "build --release"
c = "check"
t = "test"
r = "run"
i = "install --path ."
rr = "run --release"
w = "clippy -- -D warnings"
recursive_example = "rr --example recursions"
space_example = ["run", "--release", "--", "\"command list\""]

[future-incompat-report]
frequency = 'always' # when to display a notification about a future incompat report
frequency = 'always' # When to display a notification about a future incompatible report

35 changes: 35 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

if ! command -v rustc
then
echo "Rust is not installed. Please install Rust first."
exit 1
fi

if ! command -V cargo
Copy link

Copilot AI Jun 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script uses '-V' to check for cargo, but the correct flag is '-v'. This could cause the check to fail even when cargo is installed.

Suggested change
if ! command -V cargo
if ! command -v cargo

Copilot uses AI. Check for mistakes.
then
echo "cargo is not installed. Please install cargo first."
exit 1
fi

SHELL_NAME=$(basename "$SHELL")

if [ "$SHELL_NAME" = "zsh" ]; then
CONFIG_FILE="$HOME/.zshrc"
elif [ "$SHELL_NAME" = "bash" ]; then
CONFIG_FILE="$HOME/.bashrc"
else
echo "Unknown Shell : $SHELL_NAME"
exit 1
fi

echo export PATH=$PATH:~/.cargo/bin/ >> "$CONFIG_FILE"
Copy link

Copilot AI Jun 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider quoting $PATH to ensure that paths with spaces are handled correctly. For example: echo 'export PATH="$PATH:~/.cargo/bin"' >> "$CONFIG_FILE".

Suggested change
echo export PATH=$PATH:~/.cargo/bin/ >> "$CONFIG_FILE"
echo export PATH="$PATH:~/.cargo/bin/" >> "$CONFIG_FILE"

Copilot uses AI. Check for mistakes.
echo export NYX=$(pwd) >> "$CONFIG_FILE"
echo "NYX env var successfully added"

cargo br
cargo i

source "$CONFIG_FILE"

echo "NYX has been successfully installed."
6 changes: 3 additions & 3 deletions src/nxfs/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub struct ConfigSecure {
fn config_template() -> &'static str {
(r"[config]
format = 'nxs_config'
version = '0.4.0'
version = '0.4.1'

[user]
name = ''
Expand All @@ -136,12 +136,11 @@ logs = ''
cache = ''

[security]
secure_mode = false
secure_mode = true
") as _
}

pub fn config_command() {
change_work_dir(&utils::env::get_nyx_env_var());
let args: Vec<String> = env::args().collect();
if args.len() <= 2 {
command_usage(config_help());
Expand All @@ -158,6 +157,7 @@ pub fn config_command() {
}

fn init_config() {
change_work_dir(&utils::env::get_nyx_env_var());
let config_path = ".nxfs/config.toml";
let mut config_file = match File::create_new(config_path) {
Ok(f) => f,
Expand Down