Skip to content

Commit

Permalink
Fix various bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
agrojean-ledger committed Feb 15, 2024
1 parent 96e1a8c commit 2880dc1
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 15 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.1]

### Fixed

* Fix bugs introduced in 0.5.0 :
* "dependsOn" task execution string was missing when generating tasks.
* When one app detection failed, it prevented any app in the workspace to be detected afterwards.
* Extension update was not triggered properly when selecting app through the quick pick menu.

## [0.5.0]

### Added
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ This extension contributes the following settings:

## Release Notes

## 0.5.1

* Fix bugs introduced in 0.5.0 :
* "dependsOn" task execution string was missing when generating tasks.
* When one app detection failed, it prevented any app in the workspace to be detected afterwards.
* Extension update was not triggered properly when selecting app through the quick pick menu.

## 0.5.0

* New setting to allow / deny device operations on Nano X (denied by default).
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ledger-dev-tools",
"displayName": "Ledger Dev Tools",
"description": "Tools to accelerate development of apps for Ledger devices.",
"version": "0.5.0",
"version": "0.5.1",
"publisher": "LedgerHQ",
"license": "Apache",
"icon": "resources/ledger-square.png",
Expand Down
27 changes: 16 additions & 11 deletions src/appSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ function detectAppType(appFolder: vscode.Uri): [AppType?, string?] {
appTypeAndFile = ["manifest", manifest];
}
} else {
const makefile = makefileOrToml.find((file) => file.endsWith("Makefile"));
if (makefile) {
const fileContent = fs.readFileSync(makefile, "utf-8");
for (let file of makefileOrToml) {
const fileContent = fs.readFileSync(file, "utf-8");
if (fileContent.includes(C_APP_DETECTION_STRING)) {
appTypeAndFile = ["makefile", makefile];
appTypeAndFile = ["makefile", file];
break;
}
}
}
Expand All @@ -110,16 +110,21 @@ export function findAppInFolder(folderUri: vscode.Uri): App | undefined {
let compatibleDevices: LedgerDevice[] = ["Nano S", "Nano S Plus", "Nano X", "Stax"];
let testsUseCases = undefined;
let buildUseCases = undefined;
let buildDirPath = "./";

let found = true;

let [appType, appFile] = detectAppType(folderUri);
const fileContent = fs.readFileSync(appFile || "", "utf-8");
try {
let [appType, appFile] = detectAppType(folderUri);

let fileContent = "";
if (appFile) {
fileContent = fs.readFileSync(appFile || "", "utf-8");
}

let buildDirPath = path.relative(folderUri.fsPath, path.dirname(appFile || ""));
buildDirPath = buildDirPath === "" ? "./" : buildDirPath;
buildDirPath = path.relative(folderUri.fsPath, path.dirname(appFile || ""));
buildDirPath = buildDirPath === "" ? "./" : buildDirPath;

try {
switch (appType) {
case "manifest": {
console.log("Found manifest in " + appFolderName);
Expand Down Expand Up @@ -206,7 +211,7 @@ export async function showAppSelectorMenu(targetSelector: TargetSelector) {
placeHolder: "Please select an app",
onDidSelectItem: (item) => {
setSelectedApp(appList.find((app) => app.folderName === item));
testUseCaseSelected.fire();
appSelectedEmitter.fire();
},
});
getAndBuildAppTestsDependencies(targetSelector);
Expand All @@ -221,7 +226,7 @@ export async function showTestUseCaseSelectorMenu(targetSelector: TargetSelector
placeHolder: "Please select a test use case",
onDidSelectItem: (item) => {
selectedApp!.selectedTestUseCase = selectedApp!.testsUseCases?.find((testUseCase) => testUseCase.name === item);
appSelectedEmitter.fire();
testUseCaseSelected.fire();
},
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/taskProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ export class TaskProvider implements vscode.TaskProvider {
if (item.dependsOn) {
let dependResult = item.dependsOn.call(this);
if (typeof dependResult === "string") {
dependExec = dependExec + " ; ";
dependExec = dependResult + " ; ";
} else {
dependExec = dependResult[0] + " ; ";
dependFunc = dependResult[1];
Expand Down

0 comments on commit 2880dc1

Please sign in to comment.