Skip to content

Commit

Permalink
Fix #4090 Add missing docker envvar
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Yu committed Dec 12, 2023
1 parent ff147f2 commit 8d5ad8a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/compile/recipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ const logger = lw.log('Build', 'Recipe')
let prevRecipe: Recipe | undefined = undefined
let prevLangId = ''

setDockerImage()
lw.onConfigChange('docker.image.latex', setDockerImage)
function setDockerImage() {
const dockerImageName: string = vscode.workspace.getConfiguration('latex-workshop').get('docker.image.latex', '')
logger.log(`Set $LATEXWORKSHOP_DOCKER_LATEX: ${JSON.stringify(dockerImageName)}`)
process.env['LATEXWORKSHOP_DOCKER_LATEX'] = dockerImageName
}

/**
* Build LaTeX project using the recipe system. Creates Tools containing the
* tool info and adds them to the queue. Initiates a buildLoop if there is no
Expand Down
6 changes: 3 additions & 3 deletions src/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ function logConfig() {
const defaultValue = configuration.inspect(config)?.defaultValue
const configValue = configuration.get(config)
if (JSON.stringify(defaultValue) !== JSON.stringify(configValue)) {
logTagless(`${config}: ${JSON.stringify(configValue)} .`)
logTagless(`[Config] ${config}: ${JSON.stringify(configValue)} .`)
}
})
}
Expand All @@ -272,7 +272,7 @@ function logDeprecatedConfig() {
const defaultValue = configuration.inspect(config)?.defaultValue
const configValue = configuration.get(config)
if (JSON.stringify(defaultValue) !== JSON.stringify(configValue)) {
logTagless(`Deprecated config ${config} with default value ${JSON.stringify(defaultValue)} is set to ${JSON.stringify(configValue)} at ${workspace?.uri.toString(true)} .`)
logTagless(`[Config] Deprecated config ${config} with default value ${JSON.stringify(defaultValue)} is set to ${JSON.stringify(configValue)} at ${workspace?.uri.toString(true)} .`)
void vscode.window.showWarningMessage(`Config "${config}" is deprecated. ${getDefaultConfig()[config].deprecationMessage}`)
}
})
Expand All @@ -287,7 +287,7 @@ function logConfigChange(ev: vscode.ConfigurationChangeEvent) {
if (ev.affectsConfiguration(config, workspace)) {
const configuration = vscode.workspace.getConfiguration(undefined, workspace)
const value = configuration.get(config)
logTagless(`Configuration changed to { ${config}: ${JSON.stringify(value)} } at ${workspace?.uri.toString(true)} .`)
logTagless(`[Config] Configuration changed to { ${config}: ${JSON.stringify(value)} } at ${workspace?.uri.toString(true)} .`)
}
})
}
Expand Down

0 comments on commit 8d5ad8a

Please sign in to comment.