Skip to content

Commit 8b112e7

Browse files
authored
STAC-22609 (#110)
* STAC-0: Updating .gitignore * STAC-22599: stackpack scaffold creates a directory with the stackpack name instead of using the current directory * STAC-0: Remove Claude.md from .gitignore since it is not approved
1 parent 1d1d0b3 commit 8b112e7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ result
2222
release-notes.md
2323
release-notes.json
2424

25-
CLAUDE.*.md
25+
.localdev/

cmd/stackpack/stackpack_scaffold.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ sts stackpack scaffold --template-github-repo stackvista/my-templates --name my-
6969
cmd.Flags().StringVar(&args.TemplateGitHubPath, "template-github-path", "", fmt.Sprintf("Path within the repository containing template subdirectories (default: %s)", defaultTemplateGitHubPath))
7070

7171
// Common flags
72-
cmd.Flags().StringVar(&args.DestinationDir, "destination-dir", "", "Target directory where scaffolded files will be created. If not specified, uses current working directory")
72+
cmd.Flags().StringVar(&args.DestinationDir, "destination-dir", "", "Target directory where scaffolded files will be created. If not specified, creates a directory with the stackpack name in the current working directory")
7373
cmd.Flags().StringVar(&args.Name, "name", "", "Name of the stackpack (required). Must start with [a-z] and contain only lowercase letters, digits, and hyphens")
7474
cmd.Flags().StringVar(&args.DisplayName, "display-name", "", "Name that's displayed on both the StackPack listing page and on the title of the StackPack page. If not provided, the value of --name will be used")
7575
cmd.Flags().StringVar(&args.TemplateName, "template-name", defaultTemplateName, fmt.Sprintf("Name of the template subdirectory to use (default: %s)", defaultTemplateName))
@@ -91,10 +91,11 @@ func RunStackpackScaffoldCommand(args *ScaffoldArgs) func(cli *di.Deps, cmd *cob
9191
var err error
9292

9393
if args.DestinationDir == "" {
94-
args.DestinationDir, err = os.Getwd()
94+
currentDir, err := os.Getwd()
9595
if err != nil {
9696
return common.NewRuntimeError(fmt.Errorf("failed to get current working directory: %w", err))
9797
}
98+
args.DestinationDir = filepath.Join(currentDir, args.Name)
9899
}
99100

100101
// Validate stackpack name

0 commit comments

Comments
 (0)