Skip to content

Commit

Permalink
fix: trailing FQBN part if there are no configs
Browse files Browse the repository at this point in the history
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
  • Loading branch information
Akos Kitta committed Jun 27, 2023
1 parent b0422a7 commit 2473435
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arduino-ide-extension/src/common/protocol/boards-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,8 @@ export namespace ConfigOption {
const configSuffix = Object.entries(mergedOptions)
.map(([option, value]) => `${option}=${value}`)
.join(',');
return `${vendor}:${arch}:${id}:${configSuffix}`;

return `${vendor}:${arch}:${id}${configSuffix ? `:${configSuffix}` : ''}`;
}

export class ConfigOptionError extends Error {
Expand Down
6 changes: 6 additions & 0 deletions arduino-ide-extension/src/test/common/boards-service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ describe('boards-service', () => {
})
);

it('should not append the trailing boards config part to FQBN if configs is empty', () => {
const fqbn = 'a:b:c';
const actual = ConfigOption.decorate(fqbn, []);
expect(actual).to.be.equal(fqbn);
});

it('should be noop when config options is empty', () => {
const fqbn = 'a:b:c:menu1=value1';
const actual = ConfigOption.decorate(fqbn, []);
Expand Down

0 comments on commit 2473435

Please sign in to comment.