Repository navigation
Detect the constructor from the project files - #22
Merged
Merged
Conversation
'valar service init' no longer requires --type. Without it, the constructor is picked from the first of these files in the current directory: go.mod (go), package.json (node), requirements.txt or pyproject.toml (python), index.html (static), Dockerfile (docker). The choice is printed to stderr and written to .valar.yml. 'valar build push' detects it the same way when .valar.yml names no constructor. Without any of the files, the command fails with exit code 2 and lists the constructors to pass with --type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
valar service initno longer requires--type. Without it, the constructor is detected from the current directory; the first match wins:go.modgopackage.jsonnoderequirements.txtorpyproject.tomlpythonindex.htmlstaticDockerfiledockerThe choice is printed to stderr (
detected constructor: go (go.mod)) and written to.valar.yml.valar build pushdetects it the same way, from the pushed folder, when.valar.ymlnames no constructor; it does so before uploading anything. Without any of the files, the command fails with exit code 2 (invalid) and lists the constructors to pass with--type.service initnow checks for an existing.valar.ymlbefore detecting, so a refused init prints no detection note.Tests cover each layout, the precedence between markers, a directory named like a marker, and the error.