mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-22 18:56:33 +00:00
allow multiple dots.
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
parent
1f7e06f990
commit
111ba7fef3
@ -53,10 +53,9 @@ export class WorkspaceCommandContribution extends TheiaWorkspaceCommandContribut
|
||||
if (errorMessage) {
|
||||
return errorMessage;
|
||||
}
|
||||
|
||||
const extension = nameWithExt.split('.').pop();
|
||||
if (!extension) {
|
||||
return 'Invalid file extension.';
|
||||
return 'Invalid filename.'; // XXX: this should not happen as we forcefully append `.ino` if it's not there.
|
||||
}
|
||||
if (Extensions.ALL.indexOf(`.${extension}`) === -1) {
|
||||
return `.${extension} is not a valid extension.`;
|
||||
@ -72,7 +71,7 @@ export class WorkspaceCommandContribution extends TheiaWorkspaceCommandContribut
|
||||
if (name.indexOf('.') === -1) {
|
||||
return `${name}.ino`
|
||||
}
|
||||
if (name.indexOf('.') === name.length - 1) {
|
||||
if (name.lastIndexOf('.') === name.length - 1) {
|
||||
return `${name.slice(0, -1)}.ino`
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user