Skip to content

Commit 18ea23e

Browse files
author
Alberto Iannaccone
committed
force some files to be read-only
1 parent d790266 commit 18ea23e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: arduino-ide-extension/src/common/protocol/sketches-service-client-impl.ts

+9
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ import { Sketch, SketchesService } from '../../common/protocol';
1212
import { ConfigService } from './config-service';
1313
import { SketchContainer } from './sketches-service';
1414

15+
const READ_ONLY_FILES = [
16+
'thingProperties.h',
17+
'thingsProperties.h',
18+
'sketch.json',
19+
];
20+
1521
@injectable()
1622
export class SketchesServiceClientImpl
1723
implements FrontendApplicationContribution
@@ -172,6 +178,9 @@ export class SketchesServiceClientImpl
172178
if (toCheck.scheme === 'user-storage') {
173179
return false;
174180
}
181+
if (READ_ONLY_FILES.includes(toCheck?.path?.base)) {
182+
return true;
183+
}
175184
const readOnly = !this.workspaceService
176185
.tryGetRoots()
177186
.some(({ resource }) => resource.isEqualOrParent(toCheck));

0 commit comments

Comments
 (0)