mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-13 14:26:37 +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 { ConfigService } from './config-service';
|
||||||
import { SketchContainer } from './sketches-service';
|
import { SketchContainer } from './sketches-service';
|
||||||
|
|
||||||
|
const READ_ONLY_FILES = [
|
||||||
|
'thingProperties.h',
|
||||||
|
'thingsProperties.h',
|
||||||
|
'sketch.json',
|
||||||
|
];
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class SketchesServiceClientImpl
|
export class SketchesServiceClientImpl
|
||||||
implements FrontendApplicationContribution
|
implements FrontendApplicationContribution
|
||||||
@ -172,6 +178,9 @@ export class SketchesServiceClientImpl
|
|||||||
if (toCheck.scheme === 'user-storage') {
|
if (toCheck.scheme === 'user-storage') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (READ_ONLY_FILES.includes(toCheck?.path?.base)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
const readOnly = !this.workspaceService
|
const readOnly = !this.workspaceService
|
||||||
.tryGetRoots()
|
.tryGetRoots()
|
||||||
.some(({ resource }) => resource.isEqualOrParent(toCheck));
|
.some(({ resource }) => resource.isEqualOrParent(toCheck));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user