Skip to content

Commit

Permalink
Run script from cwd as target_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
wawel37 committed Nov 29, 2024
1 parent 61cca2e commit c28fa31
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions scarb/src/ops/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ use crate::compiler::plugin::proc_macro::compilation::{
};
use crate::core::publishing::manifest_normalization::prepare_manifest_for_publish;
use crate::core::publishing::source::list_source_files;
use crate::core::{Config, Package, PackageId, PackageName, Target, TargetKind, Workspace};
use crate::core::{
Config, Package, PackageId, PackageName, ScriptDefinition, Target, TargetKind, Workspace,
};
use crate::flock::{FileLockGuard, Filesystem};
use crate::internal::restricted_names;
use crate::{
Expand Down Expand Up @@ -176,7 +178,18 @@ fn package_one_impl(
"Running package script with package",
&pkg_id.to_string(),
));
ops::execute_script(script_definition, &[], ws, pkg.root(), None)?;
let absolute_path_script_definition = ScriptDefinition::new(
pkg.root()
.join(format!("{}", script_definition))
.to_string(),
);
ops::execute_script(
&absolute_path_script_definition,
&[],
ws,
target_dir.path_existent()?,
None,
)?;
}

// Package up and test a temporary tarball and only move it to the final location if it actually
Expand Down

0 comments on commit c28fa31

Please sign in to comment.