mirror of
https://github.com/pesde-pkg/pesde.git
synced 2025-04-05 19:30:57 +01:00
feat: use paths instead of pathbufs where applicable
Some checks are pending
Debug / Get build version (push) Waiting to run
Debug / Build for linux-x86_64 (push) Blocked by required conditions
Debug / Build for macos-aarch64 (push) Blocked by required conditions
Debug / Build for macos-x86_64 (push) Blocked by required conditions
Debug / Build for windows-x86_64 (push) Blocked by required conditions
Test & Lint / lint (push) Waiting to run
Some checks are pending
Debug / Get build version (push) Waiting to run
Debug / Build for linux-x86_64 (push) Blocked by required conditions
Debug / Build for macos-aarch64 (push) Blocked by required conditions
Debug / Build for macos-x86_64 (push) Blocked by required conditions
Debug / Build for windows-x86_64 (push) Blocked by required conditions
Test & Lint / lint (push) Waiting to run
This commit is contained in:
parent
aabb353d25
commit
2936f88a99
4 changed files with 16 additions and 16 deletions
|
@ -184,7 +184,7 @@ impl ExecuteCommand {
|
|||
.await
|
||||
.context("failed to download and link dependencies")?;
|
||||
|
||||
anyhow::Ok((tempdir, bin_path.clone()))
|
||||
anyhow::Ok((tempdir, bin_path.to_relative_path_buf()))
|
||||
},
|
||||
)
|
||||
.await?;
|
||||
|
|
|
@ -125,8 +125,8 @@ impl PublishCommand {
|
|||
let mut display_build_files: Vec<String> = vec![];
|
||||
|
||||
let (lib_path, bin_path, scripts, target_kind) = (
|
||||
manifest.target.lib_path().cloned(),
|
||||
manifest.target.bin_path().cloned(),
|
||||
manifest.target.lib_path().map(|p| p.to_relative_path_buf()),
|
||||
manifest.target.bin_path().map(|p| p.to_relative_path_buf()),
|
||||
manifest.target.scripts().cloned(),
|
||||
manifest.target.kind(),
|
||||
);
|
||||
|
|
|
@ -2,7 +2,7 @@ use std::path::{Component, Path};
|
|||
|
||||
use crate::manifest::{target::TargetKind, Manifest};
|
||||
use full_moon::{ast::luau::ExportedTypeDeclaration, visitors::Visitor};
|
||||
use relative_path::RelativePathBuf;
|
||||
use relative_path::RelativePath;
|
||||
|
||||
struct TypeVisitor {
|
||||
types: Vec<String>,
|
||||
|
@ -108,7 +108,7 @@ fn luau_style_path(path: &Path) -> String {
|
|||
pub fn get_lib_require_path(
|
||||
target: &TargetKind,
|
||||
base_dir: &Path,
|
||||
lib_file: &RelativePathBuf,
|
||||
lib_file: &RelativePath,
|
||||
destination_dir: &Path,
|
||||
use_new_structure: bool,
|
||||
root_container_dir: &Path,
|
||||
|
@ -190,7 +190,7 @@ return require({require_path})"#,
|
|||
/// Get the require path for a binary
|
||||
pub fn get_bin_require_path(
|
||||
base_dir: &Path,
|
||||
bin_file: &RelativePathBuf,
|
||||
bin_file: &RelativePath,
|
||||
destination_dir: &Path,
|
||||
) -> String {
|
||||
let path = pathdiff::diff_paths(destination_dir, base_dir).unwrap();
|
||||
|
@ -207,7 +207,7 @@ pub fn generate_script_linking_module(require_path: &str) -> String {
|
|||
/// Get the require path for a script
|
||||
pub fn get_script_require_path(
|
||||
base_dir: &Path,
|
||||
script_file: &RelativePathBuf,
|
||||
script_file: &RelativePath,
|
||||
destination_dir: &Path,
|
||||
) -> String {
|
||||
let path = pathdiff::diff_paths(destination_dir, base_dir).unwrap();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use relative_path::RelativePathBuf;
|
||||
use relative_path::{RelativePath, RelativePathBuf};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_with::{DeserializeFromStr, SerializeDisplay};
|
||||
use std::{
|
||||
|
@ -135,22 +135,22 @@ impl Target {
|
|||
}
|
||||
|
||||
/// Returns the path to the lib export file
|
||||
pub fn lib_path(&self) -> Option<&RelativePathBuf> {
|
||||
pub fn lib_path(&self) -> Option<&RelativePath> {
|
||||
match self {
|
||||
Target::Roblox { lib, .. } => lib.as_ref(),
|
||||
Target::RobloxServer { lib, .. } => lib.as_ref(),
|
||||
Target::Lune { lib, .. } => lib.as_ref(),
|
||||
Target::Luau { lib, .. } => lib.as_ref(),
|
||||
Target::Roblox { lib, .. } => lib.as_deref(),
|
||||
Target::RobloxServer { lib, .. } => lib.as_deref(),
|
||||
Target::Lune { lib, .. } => lib.as_deref(),
|
||||
Target::Luau { lib, .. } => lib.as_deref(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the path to the bin export file
|
||||
pub fn bin_path(&self) -> Option<&RelativePathBuf> {
|
||||
pub fn bin_path(&self) -> Option<&RelativePath> {
|
||||
match self {
|
||||
Target::Roblox { .. } => None,
|
||||
Target::RobloxServer { .. } => None,
|
||||
Target::Lune { bin, .. } => bin.as_ref(),
|
||||
Target::Luau { bin, .. } => bin.as_ref(),
|
||||
Target::Lune { bin, .. } => bin.as_deref(),
|
||||
Target::Luau { bin, .. } => bin.as_deref(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue