Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow working directory for Pulumi #190

Merged
merged 16 commits into from
Dec 7, 2023
3 changes: 2 additions & 1 deletion packages/pulumi/src/executors/preview/preview.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { which } from 'shelljs'

export interface PreviewOptions {
stack?: string
cwd?: string
}

export default async function creatExecutor(
Expand All @@ -24,7 +25,7 @@ export default async function creatExecutor(
options.stack && `--stack=${options.stack}`
]),
{
cwd: sourceRoot,
cwd: options.cwd ?? sourceRoot,
ffMathy marked this conversation as resolved.
Show resolved Hide resolved
stdio: 'inherit'
}
)
Expand Down
7 changes: 6 additions & 1 deletion packages/pulumi/src/executors/preview/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@
"type": "object",
"title": "Preview executor",
"description": "Preview",
"properties": {}
"properties": {
"cwd": {
"type": "string",
"description": "The working directory to run Pulumi commands from, if specified."
}
}
}
3 changes: 2 additions & 1 deletion packages/pulumi/src/executors/refresh/refresh.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface RefreshOptions {
stack?: string,
skipPreview?: boolean,
yes?: boolean,
cwd?: string,
}

export default async function createExecutor(
Expand All @@ -28,7 +29,7 @@ export default async function createExecutor(
options.yes && '--yes'
]),
{
cwd: sourceRoot,
cwd: options.cwd ?? sourceRoot,
stdio: 'inherit'
}
)
Expand Down
7 changes: 6 additions & 1 deletion packages/pulumi/src/executors/refresh/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@
"type": "object",
"title": "Refresh executor",
"description": "Refresh",
"properties": {}
"properties": {
"cwd": {
"type": "string",
"description": "The working directory to run Pulumi commands from, if specified."
}
}
}
7 changes: 6 additions & 1 deletion packages/pulumi/src/executors/up/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@
"type": "object",
"title": "Apply executor",
"description": "Apply",
"properties": {}
"properties": {
"cwd": {
"type": "string",
"description": "The working directory to run Pulumi commands from, if specified."
}
}
}
3 changes: 2 additions & 1 deletion packages/pulumi/src/executors/up/up.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface UpOptions {
yes?: boolean
suppressOutputs?: boolean
json?: boolean
cwd?: string
}

export default async function createExecutor(
Expand All @@ -32,7 +33,7 @@ export default async function createExecutor(
options.json && '--json'
]),
{
cwd: sourceRoot,
cwd: options.cwd ?? sourceRoot,
stdio: 'inherit'
}
)
Expand Down
Loading