Skip to content

Commit 81e61a5

Browse files
committed
fix setCurrentSettingsInTemplate
1 parent c40996d commit 81e61a5

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/newProject/utils.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,19 @@ export async function setCurrentSettingsInTemplate(
3030
) {
3131
const settingsJson = await readJSON(settingsJsonPath);
3232
const isWin = process.platform === "win32" ? "Win" : "";
33-
const customExtraVars = readParameter(
34-
"idf.customExtraVars",
35-
workspace
36-
) as { [key: string]: string };
33+
const customExtraVars = readParameter("idf.customExtraVars", workspace) as {
34+
[key: string]: string;
35+
};
3736
customExtraVars["IDF_PATH"] = idfPathDir;
3837
customExtraVars["IDF_TOOLS_PATH"] = toolsPath;
39-
38+
const adfPathDir = readParameter("idf.espAdfPath", workspace);
39+
const mdfPathDir = readParameter("idf.espMdfPath", workspace);
40+
if (adfPathDir) {
41+
settingsJson["idf.espAdfPath" + isWin] = adfPathDir;
42+
}
43+
if (mdfPathDir) {
44+
settingsJson["idf.espMdfPath" + isWin] = mdfPathDir;
45+
}
4046
settingsJson["idf.customExtraVars"] = customExtraVars;
4147
if (openOcdConfigs) {
4248
settingsJson["idf.openOcdConfigs"] =

0 commit comments

Comments
 (0)