flaky-school-70251
03/17/2022, 7:59 AMproject := auto.Project(workspace.Project{
Name: tokens.PackageName(projectName),
Runtime: workspace.NewProjectRuntimeInfo("go", nil),
Backend: &workspace.ProjectBackend{
URL: "file://~/.pulumi-local",
}, })
s, err := auto.UpsertStackInlineSource(ctx, stackName, projectName, deployFunc(configPath), project, secretsProvider, stackSettings, envvars)
My issue is that if ~/.pulumi-local
directory doesn't exist, this will fail with stderr: error: unable to open bucket file:///home/tim/.pulumi-local: stat /home/tim/.pulumi-local: no such file or directory
. If the directory exists, the code works and the stack is updated without issue.
Looking through the pulumi CLI code, the 'login' function is what would normally create the local backend directory if it doesn't exist, but I can't seem to find this functionality exposed by the SDK.