mirror of
https://github.com/SkyfallWasTaken/dinopkg.git
synced 2024-11-22 08:13:39 +00:00
Make dinopkg-package-json work without tokio
This commit is contained in:
parent
b593a5af70
commit
805f21f575
2 changed files with 4 additions and 2 deletions
|
@ -30,10 +30,12 @@ pub struct PackageJson {
|
||||||
|
|
||||||
// serde :/
|
// serde :/
|
||||||
#[allow(clippy::trivially_copy_pass_by_ref)]
|
#[allow(clippy::trivially_copy_pass_by_ref)]
|
||||||
|
#[inline(always)]
|
||||||
fn is_false(value: &bool) -> bool {
|
fn is_false(value: &bool) -> bool {
|
||||||
!value
|
!value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
fn default_as_false() -> bool {
|
fn default_as_false() -> bool {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use tokio::fs;
|
|
||||||
|
|
||||||
use crate::Error;
|
use crate::Error;
|
||||||
|
|
||||||
#[cfg(feature = "tokio")]
|
#[cfg(feature = "tokio")]
|
||||||
pub async fn find_package_json(max_attempts: usize) -> Result<Option<PathBuf>, Error> {
|
pub async fn find_package_json(max_attempts: usize) -> Result<Option<PathBuf>, Error> {
|
||||||
|
use tokio::fs;
|
||||||
|
|
||||||
let mut current_dir = env::current_dir()?;
|
let mut current_dir = env::current_dir()?;
|
||||||
for _ in 0..max_attempts {
|
for _ in 0..max_attempts {
|
||||||
let package_json_path = current_dir.join("package.json");
|
let package_json_path = current_dir.join("package.json");
|
||||||
|
|
Loading…
Reference in a new issue