Skip to content

Conversation

ngnhng
Copy link
Contributor

@ngnhng ngnhng commented Sep 26, 2025

Summary

Hi, thanks for the great project, I am currently trying to demo this my team but the current example sucked. So i went ahead and replace it with the dbos-go-starter.

@maxdml maxdml self-assigned this Sep 26, 2025
Copy link
Collaborator

@maxdml maxdml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test is failing because the template needs a variable AppName, but otherwise LGTM! Thanks @ngnhng

maxdml added a commit that referenced this pull request Sep 26, 2025
Comment on lines +74 to +76
if err := os.MkdirAll(filepath.Dir(outputPath), 0755); err != nil {
return fmt.Errorf("failed to create directory for %s: %w", outputFile, err)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed? os.Write will create the folders is needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in templates map, we have this entry:

"templates/dbos-go-starter/app.html": "html/app.html",

when outputFile is "html/app.html", filepath.Dir(outputPath) will resolve to "dbos-go-starter/html". The os.MkdirAll call then ensures that the html subdirectory is created inside the main project directory before os.WriteFile attempts to create app.html within it

so without the os.MkdirAll, we will get:

./dbos init
Error: failed to write html/app.html: open dbos-go-starter/html/app.html: no such file or directory

Co-authored-by: Max dml <maxdemoulin@gmail.com>
Copy link
Collaborator

@maxdml maxdml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution @ngnhng !

@maxdml maxdml merged commit 6ce631f into dbos-inc:main Sep 28, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants