Compare commits

...

6 Commits

@ -51,6 +51,7 @@ jobs:
draft: true
# (required) GitHub token for creating GitHub Releases.
token: ${{ secrets.GITHUB_TOKEN }}
changelog: CHANGELOG.md
# 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]
name = "nenv"
version = "0.5.0"
version = "0.5.2"
authors = ["trivernis <trivernis at proton dot me>"]
edition = "2021"
license = "GPL-3.0"

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

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

Loading…
Cancel
Save