Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove prompt from python stack
This commit removes the prompt to the user asking what Python version the project uses if it can't be detected. To achieve this, this commit also adds a function in the context to emit errors from stack plugins and allow an introspection to return undefined. The undefined return should be interpreted as an failure to introspect the stack. ref #11
- Loading branch information
Showing
7 changed files
with
97 additions
and
36 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { log } from "../../deps.ts"; | ||
|
||
interface IntrospectionError { | ||
title: string; | ||
message: string; | ||
} | ||
|
||
/** | ||
* Holds a list of fatal errors for stack introspection | ||
*/ | ||
const errorList: IntrospectionError[] = []; | ||
|
||
export const errors = { | ||
list: errorList, | ||
add: (error: IntrospectionError) => { | ||
errors.list.push(error); | ||
}, | ||
}; | ||
|
||
export const outputErrors = () => { | ||
if (!errors.list) return; | ||
const logger = log.getLogger("main"); | ||
logger.warning(`Didn't generate pipeline for every detected stack! | ||
`); | ||
for (const error of errors.list) { | ||
logger.critical(error.title); | ||
logger.error(error.message); | ||
} | ||
}; |
This file contains 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
This file contains 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