Skip to content

Commit

Permalink
feat: add console logs to better surface correct workflow for creatin…
Browse files Browse the repository at this point in the history
…g go projects
  • Loading branch information
Maed223 committed Jan 25, 2024
1 parent 7e70249 commit a75ec6f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@cdktf/cli-core/templates/go/.hooks.sscaff.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function terraformCloudConfig(baseName, organizationName, workspaceName, terrafo
cdktf.NewCloudBackend(stack, &cdktf.CloudBackendConfig{
Hostname: jsii.String("${terraformRemoteHostname}"),
Organization: jsii.String("${organizationName}"),
Workspaces: cdktf.NewNamedCloudWorkspace(jsii.String("${workspaceName}")),
Workspaces: cdktf.NewNamedCloudWorkspace(jsii.String("${workspaceName}"), nil),
})`);

// add import for jsii helper used above
Expand Down
18 changes: 18 additions & 0 deletions packages/cdktf-cli/src/bin/cmds/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,12 @@ export async function init(argv: any) {
silent: argv.silent,
});
}

if (language === Language.GO) {
console.log(
"Run 'go mod tidy' after adding imports for any needed modules such as prebuilt providers"
);
}
}

export async function list(argv: any) {
Expand Down Expand Up @@ -634,6 +640,12 @@ export async function providerAdd(argv: any) {
silent: argv.silent,
});
}

if (language === Language.GO) {
console.log(
"After adding this module to your imports, please run 'go mod tidy' to resolve newly added modules"
);
}
}

export async function providerUpgrade(argv: any) {
Expand Down Expand Up @@ -694,6 +706,12 @@ export async function providerUpgrade(argv: any) {
),
});
}

if (language === Language.GO) {
console.log(
"Update your imports to reflect this modules upgrade, then please run 'go mod tidy' to resolve newly added modules"
);
}
}

export async function providerList(argv: any) {
Expand Down

0 comments on commit a75ec6f

Please sign in to comment.