mirror of
https://github.com/SkyfallWasTaken/dinopkg.git
synced 2024-11-22 08:03:40 +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 :/
|
||||
#[allow(clippy::trivially_copy_pass_by_ref)]
|
||||
#[inline(always)]
|
||||
fn is_false(value: &bool) -> bool {
|
||||
!value
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn default_as_false() -> bool {
|
||||
false
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
use std::env;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use tokio::fs;
|
||||
|
||||
use crate::Error;
|
||||
|
||||
#[cfg(feature = "tokio")]
|
||||
pub async fn find_package_json(max_attempts: usize) -> Result<Option<PathBuf>, Error> {
|
||||
use tokio::fs;
|
||||
|
||||
let mut current_dir = env::current_dir()?;
|
||||
for _ in 0..max_attempts {
|
||||
let package_json_path = current_dir.join("package.json");
|
||||
|
|
Loading…
Reference in a new issue