Use cwd to run package.json script (#12700)
Fixes case when `package.json` is not in root directory. Usually in mono repository, where multiple `package.json` may be present Release Notes: - Fixed runnable for package.json in monorepos
This commit is contained in:
parent
377e24b798
commit
3000f6ea22
1 changed files with 2 additions and 2 deletions
|
@ -29,14 +29,14 @@ pub(super) fn json_task_context() -> ContextProviderWithTasks {
|
||||||
ContextProviderWithTasks::new(TaskTemplates(vec![
|
ContextProviderWithTasks::new(TaskTemplates(vec![
|
||||||
TaskTemplate {
|
TaskTemplate {
|
||||||
label: "package script $ZED_CUSTOM_script".to_owned(),
|
label: "package script $ZED_CUSTOM_script".to_owned(),
|
||||||
command: "npm run".to_owned(),
|
command: "npm --prefix $ZED_DIRNAME run".to_owned(),
|
||||||
args: vec![VariableName::Custom("script".into()).template_value()],
|
args: vec![VariableName::Custom("script".into()).template_value()],
|
||||||
tags: vec!["package-script".into()],
|
tags: vec!["package-script".into()],
|
||||||
..TaskTemplate::default()
|
..TaskTemplate::default()
|
||||||
},
|
},
|
||||||
TaskTemplate {
|
TaskTemplate {
|
||||||
label: "composer script $ZED_CUSTOM_script".to_owned(),
|
label: "composer script $ZED_CUSTOM_script".to_owned(),
|
||||||
command: "composer".to_owned(),
|
command: "composer -d $ZED_DIRNAME".to_owned(),
|
||||||
args: vec![VariableName::Custom("script".into()).template_value()],
|
args: vec![VariableName::Custom("script".into()).template_value()],
|
||||||
tags: vec!["composer-script".into()],
|
tags: vec!["composer-script".into()],
|
||||||
..TaskTemplate::default()
|
..TaskTemplate::default()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue