Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default function entrypoint(options = {}) {
useCloudTracing = false,
dependencies = {},
nodejsRuntime = 18,
defaultYamlFile = "app.yaml"
Copy link
Owner

Choose a reason for hiding this comment

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

I think it would make more sense to name the parameter something like 'appYamlFile' and not default, since the config overrides the default (which is app.yaml)

} = options;

return {
Expand Down Expand Up @@ -140,9 +141,9 @@ export default function entrypoint(options = {}) {

// Load existing app.yaml if it exists
let yaml = {};
if (existsSync("app.yaml")) {
builder.log.minor("Existing app.yaml found");
yaml = YAML.parse(readFileSync("app.yaml").toString());
if (existsSync(defaultYamlFile)) {
Copy link
Owner

Choose a reason for hiding this comment

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

If a yaml file is specified i think the code should throw an error if the file is not found, otherwise it can probably be a bit confusing

Copy link
Owner

Choose a reason for hiding this comment

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

Although that might be a bit more complicated to get right. I'm fine either way

builder.log.minor(`Existing ${defaultYamlFile} found`);
yaml = YAML.parse(readFileSync(defaultYamlFile).toString());
}

const serverRoutes = [
Expand Down