Compare commits

...

6 Commits

@ -51,6 +51,7 @@ jobs:
draft: true draft: true
# (required) GitHub token for creating GitHub Releases. # (required) GitHub token for creating GitHub Releases.
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
changelog: CHANGELOG.md
# Build and packages all the things # Build and packages all the things

@ -0,0 +1,14 @@
# Changelog
## 0.5.2
### Fixed
- bug on initialization where it tries to map binaries with the lts version instead of the selected one
## 0.5.1
### Fixed
- binaries are not created in bin directory when initializing nenv
- invalid lib path being used on windows

@ -1,6 +1,6 @@
[package] [package]
name = "nenv" name = "nenv"
version = "0.5.0" version = "0.5.2"
authors = ["trivernis <trivernis at proton dot me>"] authors = ["trivernis <trivernis at proton dot me>"]
edition = "2021" edition = "2021"
license = "GPL-3.0" license = "GPL-3.0"

@ -1,5 +1,3 @@
use std::{ffi::OsString, str::FromStr};
use crate::{ use crate::{
config::{ConfigAccess, ExecutableConfig}, config::{ConfigAccess, ExecutableConfig},
consts::{BIN_DIR, CACHE_DIR, VERSION_FILE_PATH}, consts::{BIN_DIR, CACHE_DIR, VERSION_FILE_PATH},
@ -12,6 +10,7 @@ use crate::{
use crossterm::style::Stylize; use crossterm::style::Stylize;
use dialoguer::{theme::ColorfulTheme, Input, Select}; use dialoguer::{theme::ColorfulTheme, Input, Select};
use miette::{Context, IntoDiagnostic, Result}; use miette::{Context, IntoDiagnostic, Result};
use std::{ffi::OsString, str::FromStr};
use tokio::fs; use tokio::fs;
pub struct Nenv { pub struct Nenv {
@ -196,6 +195,8 @@ impl Nenv {
}; };
self.repo.install_version(&version).await?; self.repo.install_version(&version).await?;
self.active_version = version;
self.get_mapper().await?.remap_additive().await?;
println!("{}", "Initialized!".green()); println!("{}", "Initialized!".green());
println!( println!(

@ -10,21 +10,27 @@ impl NodePath {
Self { base } Self { base }
} }
#[cfg(not(target_os = "windows"))] #[cfg(not(windows))]
pub fn bin(&self) -> PathBuf { pub fn bin(&self) -> PathBuf {
self.base.join("bin").canonicalize().unwrap() self.base.join("bin")
} }
pub fn lib(&self) -> PathBuf { #[cfg(windows)]
self.base.join("lib").canonicalize().unwrap() pub fn bin(&self) -> PathBuf {
self.base.to_owned()
} }
pub fn node_modules(&self) -> PathBuf { #[cfg(not(windows))]
self.lib().join("node_modules") pub fn lib(&self) -> PathBuf {
self.base.join("lib")
} }
#[cfg(target_os = "windows")] #[cfg(windows)]
pub fn bin(&self) -> PathBuf { pub fn lib(&self) -> PathBuf {
self.base.to_owned() self.base.to_owned()
} }
pub fn node_modules(&self) -> PathBuf {
self.lib().join("node_modules")
}
} }

Loading…
Cancel
Save