mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-13 06:16:33 +00:00
force some files to be read-only (#453)
This commit is contained in:
parent
5897f379a4
commit
38d372e2d5
@ -12,6 +12,12 @@ import { Sketch, SketchesService } from '../../common/protocol';
|
||||
import { ConfigService } from './config-service';
|
||||
import { SketchContainer } from './sketches-service';
|
||||
|
||||
const READ_ONLY_FILES = [
|
||||
'thingProperties.h',
|
||||
'thingsProperties.h',
|
||||
'sketch.json',
|
||||
];
|
||||
|
||||
@injectable()
|
||||
export class SketchesServiceClientImpl
|
||||
implements FrontendApplicationContribution
|
||||
@ -172,6 +178,9 @@ export class SketchesServiceClientImpl
|
||||
if (toCheck.scheme === 'user-storage') {
|
||||
return false;
|
||||
}
|
||||
if (READ_ONLY_FILES.includes(toCheck?.path?.base)) {
|
||||
return true;
|
||||
}
|
||||
const readOnly = !this.workspaceService
|
||||
.tryGetRoots()
|
||||
.some(({ resource }) => resource.isEqualOrParent(toCheck));
|
||||
|
Loading…
x
Reference in New Issue
Block a user