Skip to content

Commit

Permalink
type fix
Browse files Browse the repository at this point in the history
  • Loading branch information
danvk committed Sep 22, 2024
1 parent abac417 commit 45ce2ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions localturk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ if (writeTemplate) {
}

const [templateFile, tasksFile, outputsFile] = args;
const port = program.port || 4321;
const port = options.port || 4321;
// --static-dir is particularly useful for classify-images, where the template file is in a
// temporary directory but the image files could be anywhere.
const staticDir = program['staticDir'] || path.dirname(templateFile);
const staticDir = options['staticDir'] || path.dirname(templateFile);

type Task = {[key: string]: string};
let flash = ''; // this is used to show warnings in the web UI.
Expand All @@ -88,7 +88,7 @@ async function renderTemplate({task, numCompleted, numTotal}: TaskStats) {
// Note: these two fields are not available in mechanical turk.
fullDict['ALL_JSON'] = utils.htmlEntities(JSON.stringify(task, null, 2));
fullDict['ALL_JSON_RAW'] = JSON.stringify(task);
for (var [k, v] of Object.entries(program.var)) {
for (var [k, v] of Object.entries(options.var)) {
fullDict[k] = utils.htmlEntities(v as string);
}
const userHtml = utils.renderTemplate(template, fullDict);
Expand Down

0 comments on commit 45ce2ac

Please sign in to comment.